Print Page

Sunday, October 10, 2010

Round and round in circles on mongoid dependencies

I kept having the bug where it fails to load the binaries for bson_ext:

>rails c

**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.

After several rounds of fiddling what worked was uninstalling mongo, mongoid, bson, bson_ext and then in the Gemfile:

# Bundle gems needed for Mongoid

gem "mongoid", "~>2.0.0.beta"
gem "mongo", "1.0.9"
gem "bson", "1.0.9"
gem "bson_ext", "1.0.9", :require => false

I think among the things that had me tripped up before was that just specifying bson was getting me 1.10, but mongo is 1.0.9 and there is some version matching needed. I think the :require => false on bson_ext may be important too.

No comments:

Post a Comment