Windows7 上的 Ruby - 找不到 gem
我正在一台新的 Windows 7 机器上设置 ruby Apache Builder。 我已经安装了 Ruby、DevKit 并安装了 buildr,
gem install buildr
所有这些都运行得很完美。 直到我尝试执行 buildr 为止,然后出现错误。
buildr compile
C:/Ruby192/lib/ruby/site_ruby/1.9.1/rubygems/dependency.rb:247:in `to_specs': Could not find buildr (>= 0) amongst [atoulme-Antwrap-0.7.1, builder-2.1.2, buildr-1.4.5-x86-mswin32, buildr-as3-0.2.12, diff-lcs-1.1.2,highline-1.5.1, hoe-2.3.3, json_pure-1.4.3, minitar-0.5.3, minitest-1.6.0, net-sftp-2.0.4, net-ssh-2.0.23, rake-0.8.7, rdoc-2.5.8, rjb-1.3.2-x86-mswin32-60, rspec-2.1.0, rspec-core-2.1.0,rspec-expectations-2.1.0, rspec-mocks-2.1.0, rubyforge-2.0.3, rubygems-update-1.8.4, rubyzip-0.9.4, xml-simple-1.0.12] (Gem::LoadError)
from C:/Ruby192/lib/ruby/site_ruby/1.9.1/rubygems/dependency.rb:256:in `to_spec'
from C:/Ruby192/lib/ruby/site_ruby/1.9.1/rubygems.rb:1182:in `gem'
from C:/Ruby192/bin/buildr:18:in `<main>'
当我列出所有宝石时,
gem list buildr
一切似乎都匹配,而这个错误根本没有意义。
有什么想法吗? 帮助会很棒,我现在很绝望。 :)
I'm setting up a ruby Apache Buildr on a fresh Windows 7 machine.
I've installed Ruby, the DevKit and installed buildr via
gem install buildr
wich all ran perfect.
Until I tried to execute buildr, then I get an error.
buildr compile
C:/Ruby192/lib/ruby/site_ruby/1.9.1/rubygems/dependency.rb:247:in `to_specs': Could not find buildr (>= 0) amongst [atoulme-Antwrap-0.7.1, builder-2.1.2, buildr-1.4.5-x86-mswin32, buildr-as3-0.2.12, diff-lcs-1.1.2,highline-1.5.1, hoe-2.3.3, json_pure-1.4.3, minitar-0.5.3, minitest-1.6.0, net-sftp-2.0.4, net-ssh-2.0.23, rake-0.8.7, rdoc-2.5.8, rjb-1.3.2-x86-mswin32-60, rspec-2.1.0, rspec-core-2.1.0,rspec-expectations-2.1.0, rspec-mocks-2.1.0, rubyforge-2.0.3, rubygems-update-1.8.4, rubyzip-0.9.4, xml-simple-1.0.12] (Gem::LoadError)
from C:/Ruby192/lib/ruby/site_ruby/1.9.1/rubygems/dependency.rb:256:in `to_spec'
from C:/Ruby192/lib/ruby/site_ruby/1.9.1/rubygems.rb:1182:in `gem'
from C:/Ruby192/bin/buildr:18:in `<main>'
When I list all the gems with
gem list buildr
Everything seems to match up, and this error makes no sense at all.
Any ideas?
Help would be great, I'm getting desperate now. :)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
有同样的问题。我有 Windows 7 x64,因此使用
gem install buildr --platform mswin64
再次安装,它工作了。Had the same problem. I have Windows 7 x64 so installed again with
gem install buildr --platform mswin64
and it worked.我过去也遇到过类似的问题。
我的问题是安装类型。
我以管理员身份安装了 ruby(目标是 c:\program files)。一切工作正常 - 直到我以普通用户(而不是管理员)身份安装了 gem。
windows 端发生了什么?我没有 c:\program files 的授权,gem 安装在另一个目录中(不,没有错误,Windows 只是决定使用另一个目录。这个错误/功能称为“虚拟存储”)。
最后,Ruby 在查找文件时遇到了问题。
我的解决方案:
在 c:\program files 之外以普通用户身份安装 ruby。
当您以管理员身份安装 gem 时,也许这就足够了(但注意:如果您的虚拟商店中有一次文件,则始终会首先读取它们。)。
I had a similar problem in the past.
My problem was the kind of installation.
I installed ruby as admin (target was c:\program files). Everything worked fine - until I installed a gem as normal user (not admin).
What happened on windows side? I have no authorization for c:\program files, the gem was installed in another directory (No, there was no error, Windows just decided to use another directory. This bug/feature is called 'Virtual Store').
In the end Ruby had problems to find the files.
My solution:
Install ruby as normal user outside c:\program files.
Maybe it is enough, when you install your gems as admin (but attention: if you have once files in your Virtual store, they are read always first.).
安装了 Ruby 1.8.7,现在可以使用了。
Installed Ruby 1.8.7 instead and it works now.