Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

DOCSP-45171: Download and Install #92

Merged
merged 6 commits into from
Dec 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion snooty.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
name = "ruby-driver"
title = "Ruby MongoDB Driver"
toc_landing_pages = ["/connect"]
toc_landing_pages = [
"/get-started",
"/connect"
]

intersphinx = ["https://www.mongodb.com/docs/manual/objects.inv"]
sharedinclude_root = "https://raw.githubusercontent.com/10gen/docs-shared/main/"
Expand Down
48 changes: 48 additions & 0 deletions source/get-started.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
.. _ruby-get-started:

================================
Get Started with the Ruby Driver
================================

.. contents:: On this page
:local:
:backlinks: none
:depth: 2
:class: singlecol

.. facet::
:name: genre
:values: tutorial

.. meta::
:description: Learn how to create an app to connect to MongoDB deployment by using the Ruby driver.
:keywords: quick start, tutorial, basics

.. toctree::

Download & Install </get-started/download-and-install/>

.. TODO:
Create a Deployment </get-started/create-a-deployment>
Create a Connection String </get-started/create-a-connection-string>
Connect to MongoDB </get-started/connect-to-mongodb>
Next Steps </get-started/next-steps>

Overview
--------

The {+driver-long+} is a library that allows Ruby applications to interact with
MongoDB databases. You can use the {+driver-short+} to connect to MongoDB and perform
common data operations. This guide shows you how to create an application that uses the
{+driver-short+} to connect to a MongoDB cluster hosted on MongoDB Atlas
and query data in your cluster.

.. tip::

MongoDB Atlas is a fully managed cloud database service that hosts your MongoDB
deployments. You can create your own free (no credit card required) MongoDB Atlas
deployment by following the steps in this guide.

If you prefer to use a different driver or programming language to connect to
MongoDB, see our :driver:`list of official drivers <>`.

65 changes: 65 additions & 0 deletions source/get-started/download-and-install.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
.. _ruby-quick-start-download-and-install:

====================
Download and Install
====================

.. facet::
:name: genre
:values: tutorial

.. meta::
:keywords: installation, setup, code example

.. procedure::
:style: connected

.. step:: Install dependencies

Before you begin developing, ensure you install `Ruby
<https://www.ruby-lang.org/en/downloads/>`__ version 2.7
or later in your development environment. {+language+}
is pre-installed on macOS and some Linux distributions,
but you might need to update your version.

.. important::

The {+driver-short+} is not officially supported on Windows.

.. step:: Create a project directory

Run the following command in your shell to create a directory
called ``ruby-quickstart`` for this project:

.. code-block:: bash

mkdir ruby-quickstart

Then, run the following commands to create a ``quickstart.rb`` file in
the ``ruby-quickstart`` directory:

.. code-block:: bash

cd ruby-quickstart
touch quickstart.rb

.. step:: Add the {+driver-short+} to your project

Open the ``quickstart.rb`` file and add the following code:

.. code-block:: ruby

require 'bundler/inline'

gemfile do
source 'https://rubygems.org'
gem 'mongo'
end

This code adds the {+driver-short+} as a dependency by
using the `Bundler <https://bundler.io/>`__ dependency management tool.

After you complete these steps, you have a new project directory with the driver
dependencies installed.

.. include:: /includes/get-started/troubleshoot.rst
6 changes: 6 additions & 0 deletions source/includes/get-started/troubleshoot.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.. note::

If you run into issues on this step, ask for help in the
:community-forum:`MongoDB Community Forums <tag/ruby/>`
or submit feedback by using the :guilabel:`Rate this page`
tab on the right side of this page.
15 changes: 7 additions & 8 deletions source/index.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@
.. toctree::
:titlesonly:
:maxdepth: 1


Get Started </get-started>
Connect </connect>
View the Source <https://github.com/mongodb/mongo-ruby-driver>
API Documentation <{+api-root+}>

.. TODO:
Get Started </get-started>
Connect </connect>
Databases & Collections </databases-collections>
Read Data </read>
Write Data </write>
Expand All @@ -37,12 +37,11 @@ Introduction
Welcome to the documentation site for the {+driver-long+}, the official
MongoDB driver for {+language+} applications.

.. TODO:
.. Get Started
.. -----------
Get Started
-----------

.. Learn how to install the driver, establish a connection to MongoDB, and begin
.. working with data in the :ref:`ruby-get-started` tutorial.
Learn how to install the driver, establish a connection to MongoDB, and begin
working with data in the :ref:`ruby-get-started` tutorial.

.. Connect to MongoDB
.. ------------------
Expand Down
Loading