Bundle don't works with mongo_ext

I have a problem with a very simple Gemfile:

source :rubygems
gem 'mongo'
gem 'mongo_ext'

I installed the gems with "bundle install" but it doesn't load mongo_ext.

irb(main):001:0> require 'rubygems'
=> false
irb(main):002:0> require 'mongo'

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

=> true

But if I use the system irb I it is load:

$ irb
irb(main):001:0> require 'rubygems'
=> true
irb(main):002:0> require 'mongo'
=> true
irb(main):003:0>

Maybe that behavior is because mongo_ext includes C extensions.

Answers


You need to add bson and bson_ext to your Gemfile:

source :rubygems
gem 'mongo'
gem 'mongo_ext'
gem 'bson'
gem 'bson_ext'

And generally speaking, it's a good idea to specify versions of the gems you are using. That way you can ensure your code works even if a gem makes breaking changes (or adds new bugs that affect you). Specify the newest version that is out at the time you start your project, but upgrade them only with care. Example:

source :rubygems
gem 'mongo', '1.5.1'
gem 'mongo_ext', '0.19.3'
gem 'bson', '1.5.1'
gem 'bson_ext', '1.5.1'

Need Your Help

ERROR 1064 (42000) in Create table statement in MYSQL

mysql sql ddl create-table

The below create table statement is giving an error but everything seams OK.

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.