Ruby on rails 4 将Mongoid与Rails 4一起使用

Ruby on rails 4 将Mongoid与Rails 4一起使用,ruby-on-rails-4,mongoid,Ruby On Rails 4,Mongoid,我想在rails项目中使用Mongoid,但是gem'Mongoid'安装了1.0.6版。我尝试使用gem'mongoid',github'mongoid/mongoid',但运行bundle安装时会产生以下错误: Fetching git://github.com/mongoid/mongoid.git Unfortunately, a fatal error has occurred. Please see the Bundler troubleshooting documentation

我想在rails项目中使用Mongoid,但是
gem'Mongoid'
安装了1.0.6版。我尝试使用
gem'mongoid',github'mongoid/mongoid'
,但运行
bundle安装时会产生以下错误:

Fetching git://github.com/mongoid/mongoid.git
Unfortunately, a fatal error has occurred. Please see the Bundler
troubleshooting documentation at http://bit.ly/bundler-issues. Thanks!
C:/Ruby200/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler/source/git/git_proxy.rb:88:in ``': No such file or directo
ry - git clone "git://github.com/mongoid/mongoid.git" "C:/Ruby200/lib/ruby/gems/2.0.0/cache/bundler/git/mongoid-176c799a
8a4589043b073e277e545d697119fa82" --bare --no-hardlinks (Errno::ENOENT)
        from C:/Ruby200/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler/source/git/git_proxy.rb:88:in `git'
        from C:/Ruby200/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler/source/git/git_proxy.rb:49:in `checkout'
        from C:/Ruby200/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler/source/git.rb:144:in `specs'
        from C:/Ruby200/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler/definition.rb:493:in `block in converge_locke
d_specs'
        from C:/Ruby200/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler/definition.rb:482:in `each'
        from C:/Ruby200/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler/definition.rb:482:in `converge_locked_specs'
        from C:/Ruby200/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler/definition.rb:167:in `resolve'
        from C:/Ruby200/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler/definition.rb:114:in `specs'
        from C:/Ruby200/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler/definition.rb:109:in `resolve_remotely!'
        from C:/Ruby200/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler/installer.rb:83:in `run'
        from C:/Ruby200/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler/installer.rb:14:in `install'
        from C:/Ruby200/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler/cli.rb:247:in `install'
        from C:/Ruby200/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler/vendor/thor/task.rb:27:in `run'
        from C:/Ruby200/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler/vendor/thor/invocation.rb:120:in `invoke_task
'
        from C:/Ruby200/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler/vendor/thor.rb:344:in `dispatch'
        from C:/Ruby200/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler/vendor/thor/base.rb:434:in `start'
        from C:/Ruby200/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/bin/bundle:20:in `block in <top (required)>'
        from C:/Ruby200/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler/friendly_errors.rb:3:in `with_friendly_errors
'
        from C:/Ruby200/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/bin/bundle:20:in `<top (required)>'
        from C:/Ruby200/bin/bundle:23:in `load'
        from C:/Ruby200/bin/bundle:23:in `<main>'
抓取git://github.com/mongoid/mongoid.git
不幸的是,发生了一个致命错误。请看打包机
故障排除文档位于http://bit.ly/bundler-issues. 谢谢
C:/Ruby200/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler/source/git/git_proxy.rb:88:in```:没有这样的文件或目录
ry-git克隆”git://github.com/mongoid/mongoid.git“”C:/Ruby200/lib/ruby/gems/2.0.0/cache/bundler/git/mongoid-176c799a
8A4589043B073E277E545D69719FA82”--裸露--无硬链接(错误号::eNONT)
来自C:/Ruby200/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler/source/git/git_proxy.rb:88:in`git'
来自C:/Ruby200/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler/source/git/git_proxy.rb:49:in'checkout'
来自C:/Ruby200/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler/source/git.rb:144:in`specs'
from C:/Ruby200/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler/definition.rb:493:in`block in converge\u locke
d_规格'
from C:/Ruby200/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler/definition.rb:482:in'each'
来自C:/Ruby200/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler/definition.rb:482:in'converge\u locked\u specs'
from C:/Ruby200/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler/definition.rb:167:in'resolve'
来自C:/Ruby200/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler/definition.rb:114:in'specs'
来自C:/Ruby200/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler/definition.rb:109:in'resolve_remote!'
来自C:/Ruby200/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler/installer.rb:83:in'run'
来自C:/Ruby200/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler/installer.rb:14:in'install'
来自C:/Ruby200/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler/cli.rb:247:in'install'
来自C:/Ruby200/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler/vendor/thor/task.rb:27:in'run'
来自C:/Ruby200/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler/vendor/thor/invocation.rb:120:in`invoke_task
'
来自C:/Ruby200/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler/vendor/thor.rb:344:in'dispatch'
from C:/Ruby200/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler/vendor/thor/base.rb:434:in'start'
从C:/Ruby200/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/bin/bundle:20:in'block-in'
from C:/Ruby200/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler/friendly\u errors.rb:3:in`with\u friendly\u errors
'
来自C:/Ruby200/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/bin/bundle:20:in`'
从C:/Ruby200/箱/捆:23:在“装载”中
来自C:/Ruby200/bin/bundle:23:in`'

尝试
gem安装mongoid
它应该允许您直接安装mongoid gem,而无需通过bundler


之后,再次尝试运行
bundle

我怀疑错误是因为您没有安装Git。有关设置的帮助,请参阅本教程:

Nope,仍然安装版本1.0.6,已有3年历史