0
工作我有一个问题有一个非常简单的Gemfile:捆绑不mongo_ext
source :rubygems
gem 'mongo'
gem 'mongo_ext'
我安装了宝石“包安装”,但它不会加载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
但是,如果使用系统IRB我是负载:
$ irb
irb(main):001:0> require 'rubygems'
=> true
irb(main):002:0> require 'mongo'
=> true
irb(main):003:0>
也许这种行为是因为mongo_ext包括C扩展。
您是否试过'gem install bson_ext',因为它建议? –
我已安装它。当我使用'irb'时,它在我需要'mongo'时加载,但是当我使用'mongo exec ruil'时,它不会被加载。 –