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

  • Home
  • SEARCH
  • 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 3218398
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T15:31:23+00:00 2026-05-17T15:31:23+00:00

I downloaded the mongo_mapper gem and it installed successfully. Now, I am using it

  • 0

I downloaded the mongo_mapper gem and it installed successfully. Now, I am using it in my app and it always throws exception “No file to load mongo_mapper”. What is that supposed to mean?

require 'mongo_mapper'

include mongo

UPDATE: After using require ‘rubygems’ first. My original problem is gone now there is another weird problem:

I get the following:

**Notice: C extension not loaded. This is required for optimum MongoDB Ruby driver performance.
  You can install the extension as follows:
  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 and that the bson_ext and mongo gems are of the same version.

I already installed bson_ext but it keeps throwing this exception!

UPDATE 2: bson warning is now gone but I am not able to list the items in the Customers collection.

require 'rubygems'
require 'mongo_mapper'

include Mongo

MongoMapper.database = 'Northwind'

class Customer
  include MongoMapper::Document

  key :FirstName, String
  key :LastName, String
  key :UserName, String
end


customers = Customer.all

puts customers.count # this always is 0. It should be 1 since there is one item in the Customers collection

puts customers
  • 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-05-17T15:31:24+00:00Added an answer on May 17, 2026 at 3:31 pm

    You need to include rubygems before you include a gem.

    require 'rubygems'
    require 'mongo_mapper'
    

    I’m also pretty sure your next line include mongo is incorrect, you probably want include Mongo. Actually you probably want nothing at all, since your plan is to use MongoMapper, not the driver directly.

    Update:

    As for the bson_ext thing, it’s not an exception, just a warning. Obviously for production use you would want to sort this out and you can do so by ensuring that you have the latest gems installed: sudo gem install mongo bson_ext mongo_mapper which should tell you (as of October 4th, 2010) that it installed mongo 1.1, bson_ext 1.1 and mongo_mapper 0.8.4.

    Update 2:

    Need more information. Does the customer you expect to appear show up in the mongo shell? How did you insert it? Are you sure the collection names are right?

    So, if you used some .NET thing to make the dataset and can’t change it now, you can specify the collection name by hand for your MongoMapper document. Like so:

    class Customer
      include MongoMapper::Document
      set_collection_name 'Customers'
    
      # other stuff
    end
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I downloaded and installed the Aptana Studio free version. But apparently, to install the
I downloaded Hex Workshop, and I was told to read a .dbc file. It
have downloaded Orca to edit an MSI file. I want to remove some banner
I have downloaded a font that looks less than desirable if it is not
I recently downloaded the source tarball for a GTK application that I'd like to
I have an iPhone app that publishes through Bonjour. The Mac counterpart works, they
I've downloaded log4net, but I've realised that there are different assemblies for .NET and
I downloaded System.Data.SQLite , and tried to compile the following sample code. using System;
I downloaded Reflector.Net and it's an .Exe outside VS. I remember (last year) when
Having downloaded Pango and GLib from the GTK+ Project's Win32 downloads page and having

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.