有一個類似的問題'bson_ext',但它不適合我。MongoId和bson_ext問題:沒有這樣的文件加載 - bson_ext
MongoMapper and bson_ext problem
我用Rails 2.3.8 + MongoId 1.9.1。我跟着 「installation」 頁面:
gem install mongoid
gem install mongo -v=1.0.4
gem install bson_ext -v=1.0.4
在我的config/environment.rb中,我說:
config.gem 'mongoid'
config.gem 'mongo', :version=>'1.0.4'
config.gem 'bson_ext', :verstion=>'1.0.4'
當我開始ruby script/server
的應用程序,它顯示:
=> Booting WEBrick
=> Rails 2.3.8 application starting on http://0.0.0.0:3000
no such file to load -- bson_ext
/usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
/usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
/usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:156:in `require'
/usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:521:in `new_constants_in'
...
/usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
/usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
script/server:3
Missing these required gems:
bson_ext = 1.0.4
You're running:
ruby 1.8.7.299 at /usr/local/bin/ruby
rubygems 1.3.7 at /root/.gem/ruby/1.8, /usr/local/lib/ruby/gems/1.8
Run `rake gems:install` to install the missing gems.
但我已經安裝了bson_ext 1.0.4
:
gem list
bson (1.0.4, 1.0.3, 1.0.1, 1.0)
bson_ext (1.0.4, 1.0.1, 1.0)
mongo (1.0.4, 1.0.1, 1.0)
mongoid (1.9.1)
mongo_ext (0.19.3)
而且,我嘗試過使用1.0和1.0.1,但是拋出了相同的異常。
怎麼了?
所以你運行沒有bson_ext庫? – 2010-07-16 00:15:08
是的,這是正確的。我將嘗試在我的下一個實例中僅使用「config.gem」mongoid'「進行全新安裝,以確認這一點。 – rxgx 2010-07-19 19:38:44