Skip to content

Instantly share code, notes, and snippets.

Created January 9, 2013 00:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/4489300 to your computer and use it in GitHub Desktop.
Save anonymous/4489300 to your computer and use it in GitHub Desktop.
ruby mongodb driver 1.8.1 not connecting (legacy connection) to db on Debian GNU/Linux (1.8.0 and 1.7.x could)
require 'mongo'
con = Mongo::Connection.new('127.0.0.1', 27017)
source :rubygems
#gem 'mongo', '1.7.1'
#gem 'mongo', '1.8.0'
gem 'mongo', '1.8.1'
jmettraux@tachibana ~/tmp/mongo 立 bundle exec ruby code.rb
** Notice: The native BSON extension was not loaded. **
For optimal performance, use of the BSON extension is recommended.
To enable the extension make sure ENV['BSON_EXT_DISABLED'] is not set
and run the following command:
gem install bson_ext
If you continue to receive this message after installing, make sure that
the bson_ext gem is in your load path.
/home/jmettraux/.rvm/gems/ruby-1.9.3-p194/gems/mongo-1.8.1/lib/mongo/mongo_client.rb:479:in `connect': Failed to connect to a master node at 127.0.0.1:27017 (Mongo::ConnectionFailure)
from /home/jmettraux/.rvm/gems/ruby-1.9.3-p194/gems/mongo-1.8.1/lib/mongo/mongo_client.rb:631:in `setup'
from /home/jmettraux/.rvm/gems/ruby-1.9.3-p194/gems/mongo-1.8.1/lib/mongo/mongo_client.rb:147:in `initialize'
from /home/jmettraux/.rvm/gems/ruby-1.9.3-p194/gems/mongo-1.8.1/lib/mongo/legacy.rb:56:in `initialize'
from code.rb:3:in `new'
from code.rb:3:in `<main>'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment