在 IronRuby 上安装任何 gem 时出错
从今天起我对 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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
使用 OpenSSL 库时发生错误。
所以这个问题可以通过使用ruby标准OpenSSL库来解决,而不是IronRuby的库。
我认为您可以按照以下过程安装该库。
SSL验证功能一旦失效。
将下一行添加到 ~/.gemrc(%HOME%\.gemrc) 文件中。
(如果不退出,则创建)
在此,使用“igem”。
但不推荐这种状态。
安装 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)
In this, 'igem' is usabled.
But this state isn't recommend.
Install OpenSSL library, like this :
And, restore ~/.gemrc file.
'igem' remains to be usabled.
对于遇到此问题的其他人来说,对我有用的解决方案是使用标准 Ruby gem 命令并将安装目录设置为 IronRuby gem 位置。
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.
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.