无法在Windows上使用Rails 3安装Mongoid [英] Trouble installing Mongoid with Rails 3 on Windows
问题描述
在我的Gemfile中:
In my Gemfile:
gem "mongoid", "~> 2.3"
gem "bson_ext", "~> 1.4"
当我运行bundle install
时,出现以下错误:
When I run bundle install
I get the error below:
Bundler could not find compatible versions for gem "activemodel":
In Gemfile:
mongoid (~> 2.3) x86-mingw32 depends on
activemodel (~> 3.1) x86-mingw32
rails (= 3.0.6) x86-mingw32 depends on
activemodel (3.0.6)
正如其他文章所建议的那样,我尝试指向该版本的github,但是当我这样做并运行bundle install
时,出现另一个错误:
I've tried pointing to github for the version, as is suggested in some other posts, but when I do this and run bundle install
, I get another error:
Fetching http://github.com/mongoid/mongoid.git
C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.21/lib/bundler/source.rb:579:in
``': No such file or directory - git clone "http://github.com/mongoid/mongoid.gi
t" "C:/Ruby192/lib/ruby/gems/1.9.1/cache/bundler/git/mongoid-96bbbaf83f2d1e3487e
c2c95b9e5148015a7a346" --bare --no-hardlinks (Errno::ENOENT)
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.21/lib/bundler/sour
ce.rb:579:in `git'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.21/lib/bundler/sour
ce.rb:653:in `cache'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.21/lib/bundler/sour
ce.rb:551:in `specs'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.21/lib/bundler/defi
nition.rb:356:in `block in converge_locked_specs'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.21/lib/bundler/defi
nition.rb:345:in `each'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.21/lib/bundler/defi
nition.rb:345:in `converge_locked_specs'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.21/lib/bundler/defi
nition.rb:143:in `resolve'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.21/lib/bundler/defi
nition.rb:90:in `specs'
任何提示都值得赞赏.谢谢!
Any tips are appreciated. Thanks!
推荐答案
如果我没记错的话,bson_ext需要本地构建.这意味着您必须以某种方式在Windows上构建它.错误指向x86-mingw32,可以从此处
If I recall correctly, bson_ext needs to be built natively. This means that somehow you must build it on Windows. The errors are pointing to x86-mingw32, which can be downloaded from here
之所以需要它,是因为有一些库依赖于平台.希望这能为您指明正确的方向.
The reason you would need that is because there are a couple of libraries that are platform dependent. Hope this sets you in the right direction.
这篇关于无法在Windows上使用Rails 3安装Mongoid的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!