Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8618837
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T06:12:00+00:00 2026-06-12T06:12:00+00:00

I have a library I was working on have left it for a while,

  • 0

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
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T06:12:01+00:00Added an answer on June 12, 2026 at 6:12 am

    Mongoid 3.x does not use the mongo gem anymore, it uses a driver called moped developed by the Mongoid team.

    If you want to stick with the official 10gen driver you would need to update your Gemfile to specify you want to stick with Mongoid 2.x:

    gem "mongoid", "~> 2.0"
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an audio project I'm working on using BASS from Un4seen. This library
I have integrated Zxing library in my Android application, and it is Perfectly working,
I'm working on a media library mock-up and I have a database of songs
I have a third party library which I finally have working within my MonoTouch
I am working on online pdf library project. In this I have a feature
I am working on a class library using C#. I have designed 3 main
UPDATE I have reverted back to Jquery 1.3.2 and everything is working, not sure
I am turning an project that I have been working on for while into
I'm trying to reuse some script that I have working on another page, but
I have a User Control Library that I am loading dynamically. From that lib

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.