-
Notifications
You must be signed in to change notification settings - Fork 28
DOCSP-45171: Download and Install #92
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 3 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,49 @@ | ||||||||||
.. _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. | ||||||||||
|
||||||||||
Follow this guide to connect a sample Ruby application to a MongoDB Atlas | ||||||||||
deployment. If you prefer to connect to MongoDB using a different driver or | ||||||||||
programming language, see our :driver:`list of official drivers <>`. | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -0,0 +1,78 @@ | ||||||
.. _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 being developing, ensure you have the following dependencies | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. oops, thanks for catching |
||||||
installed in your development environment: | ||||||
|
||||||
- `Ruby <https://www.ruby-lang.org/en/downloads/>`__ version 2.7 | ||||||
or later | ||||||
- `bson <https://rubygems.org/gems/bson>`__ versions 4.14.1 to 6.0 | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Q: do they need all of these you could consider making this a step in the following procedure, since that's also where they install the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No, I meant the version must be greater than 4.14.1 and less than 6.0 |
||||||
|
||||||
.. note:: | ||||||
|
||||||
{+language+} is pre-installed on macOS and some Linux distributions, | ||||||
but the system version might be outdated. You can use a package | ||||||
manager, such as `Homebrew <https://formulae.brew.sh/formula/ruby>`__, | ||||||
to install the latest {+language+} version. | ||||||
|
||||||
.. step:: Install the {+driver-short+} | ||||||
|
||||||
From your shell, run the following command to install | ||||||
the {+driver-short+}: | ||||||
|
||||||
.. code-block:: bash | ||||||
|
||||||
gem install mongo | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Installing gems using It might be better to use bundler for managing the getting started project. Any modern distribution of Ruby comes with Bundler preinstalled by default. If the project is going to be a single file, then inlined bundler is ideal: require 'bundler/inline'
gemfile do
source 'https://rubygems.org'
gem 'mongo'
end There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's just a single file, so I will add inlined bundler instructions |
||||||
|
||||||
This command installs version {+version-number+} of | ||||||
the driver. | ||||||
|
||||||
.. 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 | ||||||
|
||||||
Select the tab corresponding to your operating system and run the following commands | ||||||
to create a ``quickstart.rb`` file in the ``ruby-quickstart`` directory: | ||||||
|
||||||
.. tabs:: | ||||||
|
||||||
.. tab:: macOS / Linux | ||||||
:tabid: create-file-mac-linux | ||||||
|
||||||
.. code-block:: bash | ||||||
|
||||||
cd ruby-quickstart | ||||||
touch quickstart.rb | ||||||
|
||||||
.. tab:: Windows | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We do not officially support Ruby driver on Windows, so I am not sure if Windows should be mentioned in the getting started. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Added a note about this |
||||||
:tabid: create-file-windows | ||||||
|
||||||
.. code-block:: bash | ||||||
|
||||||
cd ruby-quickstart | ||||||
type nul > quickstart.rb | ||||||
|
||||||
After you complete these steps, you have a new project directory with the driver | ||||||
dependencies installed. | ||||||
|
||||||
.. include:: /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 or bottom right side of this page. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Q: do you know why we specify both locations? this was only on the top right on the pages i checked There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe it depends on the browser/device? not sure, but I'll reword to just "right side" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this first sentence needed after the last sentence in the previous (non-tip) paragraph?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems repetitive, I'll remove it