bson_ext install for Ruby on Rails with Mongo DB

If you're following this guide on MongoDB with Ruby on Rails, and you get an error message There was an error in your Gemfile, and Bundler cannot continue after entering bundle install, you can follow the steps specified in this post to complete the "Bundling" stage.

I am assuming that you've tried the recommended work around and yet still getting the error message above.

First, install bson_ext.

gem install bson_ext


Successfully installed bson-1.9.2
Fetching: bson_ext-1.9.2.gem (100%)
Building native extensions.  This could take a while...
Successfully installed bson_ext-1.9.2
Parsing documentation for bson-1.9.2
Installing ri documentation for bson-1.9.2
Parsing documentation for bson_ext-1.9.2
Installing ri documentation for bson_ext-1.9.2
Done installing documentation for bson, bson_ext after 0 seconds
2 gems installed

Instead of requiring or loading 'rubygems', we'll just make sure that both mongo and bson_ext are in our load path when we require mongo

To load both mongo and bson_ext in your path, edit the application.rb file.