Ruby on Windows 7 - 找不到gem

时间:2011-05-31 17:47:29

标签: ruby windows-7 gem buildr

我在新的Windows 7机器上设置了一个ruby Apache Buildr。 我已经安装了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

一切似乎都匹配,而这个错误完全没有意义。 enter image description here

有什么想法吗? 帮助会很棒,我现在变得绝望了。 :)

3 个答案:

答案 0 :(得分:2)

有同样的问题。我有Windows 7 x64,所以再次使用gem install buildr --platform mswin64安装它并且它可以工作。

答案 1 :(得分:1)

我过去也遇到过类似的问题。

我的问题是那种安装。 我以管理员身份安装了ruby(目标是c:\ program files)。一切正常 - 直到我以普通用户(不是管理员)安装了一个gem。

在Windows端发生了什么?我没有c:\ program文件的授权,gem安装在另一个目录中(不,没有错误,Windows只是决定使用另一个目录。这个bug /功能称为'Virtual Store')。

最后Ruby遇到了查找文件的问题。

我的解决方案: 在c:\ program files之外以普通用户身份安装ruby。

当你以管理员的身份安装你的宝石时,也许这已经足够了(但是注意:如果你的虚拟商店中有一个文件,那么它们总是先被读取。)。

答案 2 :(得分:1)

安装Ruby 1.8.7而现在可以正常工作。