I have a library I was working on have left it for a while, when I went back to work on it, it's still fine but when I updated gems: mongoid from 2.4.5
to 3.0.6
and also updated mongo and bson_ext from 1.6.0
to 1.7.0
and when run my rspec I get error
<top (required)>': uninitialized constant Mongo (NameError)
from
Mongoid.configure do |config|
config.master = Mongo::Connection.new.db("db_test")
end
I have: ruby 1.9.3p125 mongodb 2.0.2-x86_64
This one has the same problem Mongoid gives uninitialized constant Mongo but the solution didn't work for me.
Adding require "mongo"
on mine gives a different error:
spec_helper.rb:11:in 'block in <top (required)>': undefined method 'master=' for Mongoid::Config:Module (NoMethodError)
EDIT I still used 3.x and this is now how they do connections
Mongoid.configure do |config|
config.connect_to("db_test")
end