在 IronRuby 上安装任何 gem 时出错

发布于 2024-12-23 07:30:04 字数 1172 浏览 5 评论 0原文

从今天起我对 Ruby 是全新的。我安装了 IronRuby,因为我是一名 .NET 开发人员,它似乎对 Windows 7 的占用较小。

一切进展顺利,直到我需要安装 Gem 来解析 HTML。我发出以下命令:

igem install rokogiri

并收到以下错误:

ERROR:  While executing gem ... (NoMethodError)
    undefined method `set_params' for #<OpenSSL::SSL::SSLContext:0x00001ba>

运行 igem env 产量:

RubyGems Environment:
  - RUBYGEMS VERSION: 1.3.7
  - RUBY VERSION: 1.9.2 (2010-08-18 patchlevel 0) [i386-mswin32]
  - INSTALLATION DIRECTORY: C:/Program Files (x86)/IronRuby 1.1/Lib/ruby/gems/1.9.1
  - RUBY EXECUTABLE: "C:/Program Files (x86)/IronRuby 1.1/bin/ir.exe"
  - EXECUTABLE DIRECTORY: C:/Program Files (x86)/IronRuby 1.1/bin
  - RUBYGEMS PLATFORMS:
    - ruby
    - universal-dotnet-4.0
  - GEM PATHS:
     - C:/Program Files (x86)/IronRuby 1.1/Lib/ruby/gems/1.9.1
     - P:/.gem/ironruby/1.9.1
  - GEM CONFIGURATION:
     - :update_sources => true
     - :verbose => true
     - :benchmark => false
     - :backtrace => false
     - :bulk_threshold => 1000
  - REMOTE SOURCES:
     - http://rubygems.org/

我在 Google 上的搜索毫无结果。有人有什么建议吗?

谢谢!

I am brand new to Ruby as of today. I installed IronRuby as I am a .NET developer and it seems to have a lighter footprint for Windows 7.

Things have been proceeding well, until I needed to install a Gem to parse HTML. I am issuing the following command:

igem install rokogiri

and receiving the following error:

ERROR:  While executing gem ... (NoMethodError)
    undefined method `set_params' for #<OpenSSL::SSL::SSLContext:0x00001ba>

Running igem env yields:

RubyGems Environment:
  - RUBYGEMS VERSION: 1.3.7
  - RUBY VERSION: 1.9.2 (2010-08-18 patchlevel 0) [i386-mswin32]
  - INSTALLATION DIRECTORY: C:/Program Files (x86)/IronRuby 1.1/Lib/ruby/gems/1.9.1
  - RUBY EXECUTABLE: "C:/Program Files (x86)/IronRuby 1.1/bin/ir.exe"
  - EXECUTABLE DIRECTORY: C:/Program Files (x86)/IronRuby 1.1/bin
  - RUBYGEMS PLATFORMS:
    - ruby
    - universal-dotnet-4.0
  - GEM PATHS:
     - C:/Program Files (x86)/IronRuby 1.1/Lib/ruby/gems/1.9.1
     - P:/.gem/ironruby/1.9.1
  - GEM CONFIGURATION:
     - :update_sources => true
     - :verbose => true
     - :benchmark => false
     - :backtrace => false
     - :bulk_threshold => 1000
  - REMOTE SOURCES:
     - http://rubygems.org/

My searches on Google have been fruitless. Does anyone have any suggestions?

Thanks!

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

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

发布评论

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

评论(2

打小就很酷 2024-12-30 07:30:04

使用 OpenSSL 库时发生错误。
所以这个问题可以通过使用ruby标准OpenSSL库来解决,而不是IronRuby的库。
我认为您可以按照以下过程安装该库。


SSL验证功能一旦失效。
将下一行添加到 ~/.gemrc(%HOME%\.gemrc) 文件中。
(如果不退出,则创建)

:ssl_verify_mode: 0

在此,使用“igem”。
但不推荐这种状态。

安装 OpenSSL 库,如下所示:

> igem install rubysl-openssl

并且,恢复 ~/.gemrc 文件。
'igem' 仍有待使用。

The error happens in using OpenSSL library.
So this problem can be solved to use ruby standard OpenSSL library, not the library of IronRuby.
I think you can install the library in the following procedure.


Invalidate the function of SSL verifying once.
Add the next line to ~/.gemrc(%HOME%\.gemrc) file.
(if it doesn't exit, create)

:ssl_verify_mode: 0

In this, 'igem' is usabled.
But this state isn't recommend.

Install OpenSSL library, like this :

> igem install rubysl-openssl

And, restore ~/.gemrc file.
'igem' remains to be usabled.

时光无声 2024-12-30 07:30:04

对于遇到此问题的其他人来说,对我有用的解决方案是使用标准 Ruby gem 命令并将安装目录设置为 IronRuby gem 位置。

gem install --install-dir "c:/Program Files (x86)/IronRuby 1.1/lib/ironruby/gems/1.8" -V  json_pure

igem 看起来确实是一个非常基本的 Ruby 脚本,它封装了 Ruby gem 命令。 OpenSSL 错误似乎有点转移注意力,可能是因为默认的 gem 存储库 URL 现在重定向到不同的位置,而 igem 脚本不处理该问题。

For anyone else that comes across this a solution that worked for me was to use the standard Ruby gem command and set the install directory to the IronRuby gem location.

gem install --install-dir "c:/Program Files (x86)/IronRuby 1.1/lib/ironruby/gems/1.8" -V  json_pure

igem does look like it's a very basic Ruby script that wraps up the Ruby gem command. The OpenSSL error seems to be a bit of a red herring and is probably because the default gem repository URL now redirects to a different location and the igem script doesn't deal with that.

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