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'時,它不會被加載。 –