Navigation
This version of the documentation is archived and no longer supported.

Installation

The Ruby driver is bundled as a gem and is hosted on Rubygems.

Install the gem

The driver can be installed manually or with bundler.

To install the gem manually:

gem install mongo

To install the gem with bundler, include the following in your Gemfile:

gem 'mongo', '~> 2.3'

Note the following compatibility matrix to determine if the driver is supported on your Ruby version and MongoDB server version.

Ruby Version MongoDB Server 2.4.x MongoDB Server 2.6.x MongoDB Server 3.0.x
1.8.x No No No
1.9.x Yes Yes Yes
2.0.x Yes Yes Yes
2.1.x Yes Yes Yes
2.2.x Yes Yes Yes
JRuby 1.7.x Yes Yes Yes