Windows7 上的 Ruby - 找不到 gem

发布于 2024-11-11 22:38:12 字数 1165 浏览 2 评论 0原文

我正在一台新的 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.
enter image description here

Any ideas?
Help would be great, I'm getting desperate now. :)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

余生再见 2024-11-18 22:38:12

有同样的问题。我有 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.

凡尘雨 2024-11-18 22:38:12

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

我的问题是安装类型。
我以管理员身份安装了 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.).

佞臣 2024-11-18 22:38:12

安装了 Ruby 1.8.7,现在可以使用了。

Installed Ruby 1.8.7 instead and it works now.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文