title: Mongoid: uninitialized constant Mongo (NameError)
body: <p>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 <code>2.4.5</code> to <code>3.0.6</code> and also updated mongo and bson_ext from <code>1.6.0</code> to <code>1.7.0</code> and when run my rspec I get error </p>
  
  <p><code>&lt;top (required)&gt;': uninitialized constant Mongo (NameError)</code> from</p>
  
  <pre><code>Mongoid.configure do |config|
    config.master = Mongo::Connection.new.db("db_test")
  end
  </code></pre>
  
  <p>I have:
  ruby 1.9.3p125
  mongodb 2.0.2-x86_64</p>
  
  <p>This one has the same problem
  <a href="https://stackoverflow.com/questions/12188219/mongoid-gives-uninitialized-constant-mongo">Mongoid gives uninitialized constant Mongo</a>
  but the solution didn't work for me.</p>
  
  <p>Adding <code>require "mongo"</code> on mine gives a different error:</p>
  
  <p><code>
  spec_helper.rb:11:in 'block in &lt;top (required)&gt;': undefined method 'master=' for Mongoid::Config:Module (NoMethodError)
  </code></p>
  
  <p><strong>EDIT</strong>
  I still used 3.x and this is now how they do connections</p>
  
  <pre><code>Mongoid.configure do |config|
    config.connect_to("db_test")
  end
  </code></pre>