无法在 IronRuby 中加载 gem

发布于 2024-08-06 12:06:42 字数 1362 浏览 6 评论 0原文

我已经删除了所有环境变量和 ruby​​/ironruby 目录并从头开始重新安装。然后我通过igem安装了mocha。这是我的输出。

$ ir
IronRuby 0.9.1.0 on .NET 2.0.50727.3082
Copyright (c) Microsoft Corporation. All rights reserved.

>>> require 'mocha'
:0:in `require': no such file to load -- mocha (LoadError)
        from :0

列出我安装的 gem。 。 。

$ igem list --local

*** LOCAL GEMS ***

mocha (0.9.8)
rake (0.8.7)

这是我的宝石环境。

$ igem environment
RubyGems Environment:
  - RUBYGEMS VERSION: 1.3.5
  - RUBY VERSION: 1.8.6 (2008-05-28 patchlevel 0) [i386-mswin32]
  - INSTALLATION DIRECTORY: C:/ironruby/lib/IronRuby/../..//lib/ironruby/gems/1.8
  - RUBY EXECUTABLE: C:/ironruby/lib/IronRuby/../..//bin/ir.exe
  - EXECUTABLE DIRECTORY: C:/ironruby/lib/IronRuby/../..//bin
  - RUBYGEMS PLATFORMS:
    - ruby
    - x86-mswin32-60
  - GEM PATHS:
     - C:/ironruby/lib/IronRuby/../..//lib/ironruby/gems/1.8
     - C:/Documents and Settings/vitalim/.gem/ironruby/1.8
  - GEM CONFIGURATION:
     - :update_sources => true
     - :verbose => true
     - :benchmark => false
     - :backtrace => false
     - :bulk_threshold => 1000
     - :sources => ["http://gems.rubyforge.org/", "http://gems.github.com"]
  - REMOTE SOURCES:
     - http://gems.rubyforge.org/
     - http://gems.github.com

希望你能帮助我:(

I already removed all environment variables and ruby/ironruby directories and reinstalled it from scratch. And then I installed mocha through igem. Here are my outputs.

$ ir
IronRuby 0.9.1.0 on .NET 2.0.50727.3082
Copyright (c) Microsoft Corporation. All rights reserved.

>>> require 'mocha'
:0:in `require': no such file to load -- mocha (LoadError)
        from :0

Listing my installed gems. . .

$ igem list --local

*** LOCAL GEMS ***

mocha (0.9.8)
rake (0.8.7)

This is my gem environment.

$ igem environment
RubyGems Environment:
  - RUBYGEMS VERSION: 1.3.5
  - RUBY VERSION: 1.8.6 (2008-05-28 patchlevel 0) [i386-mswin32]
  - INSTALLATION DIRECTORY: C:/ironruby/lib/IronRuby/../..//lib/ironruby/gems/1.8
  - RUBY EXECUTABLE: C:/ironruby/lib/IronRuby/../..//bin/ir.exe
  - EXECUTABLE DIRECTORY: C:/ironruby/lib/IronRuby/../..//bin
  - RUBYGEMS PLATFORMS:
    - ruby
    - x86-mswin32-60
  - GEM PATHS:
     - C:/ironruby/lib/IronRuby/../..//lib/ironruby/gems/1.8
     - C:/Documents and Settings/vitalim/.gem/ironruby/1.8
  - GEM CONFIGURATION:
     - :update_sources => true
     - :verbose => true
     - :benchmark => false
     - :backtrace => false
     - :bulk_threshold => 1000
     - :sources => ["http://gems.rubyforge.org/", "http://gems.github.com"]
  - REMOTE SOURCES:
     - http://gems.rubyforge.org/
     - http://gems.github.com

Hope you can hep me with this :(

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

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

发布评论

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

评论(1

不念旧人 2024-08-13 12:06:42

require 'rubygems' 然后 require 'mocha' 在这种情况下应该可以工作。需要 ruby​​gems 设置需要能够找到您的宝石。

require 'rubygems' then require 'mocha' should work in this case. Require'ing rubygems sets up require to be able to find your gems.

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