欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

jruby 下升级 gem 版本的问题

程序员文章站 2024-03-11 15:56:43
...

ruby的三方包管理工具是gem,jruby自然也不例外,但是最近遇到一个问题:新安装的jruby不能成功的升级 gem 系统

 

$ gem update --system
Updating RubyGems
Updating rubygems-update
Successfully installed rubygems-update-1.8.1
Updating RubyGems to 1.8.1
Installing RubyGems 1.8.1
/home/john/.rvm/rubies/jruby-1.5.6/lib/ruby/site_ruby/1.8/rubygems/defaults/jruby.rb:1224:in `require': undefined method `set_paths' for class `#<Class:01x5bf8d5b0>' (NameError)
	from /home/john/.rvm/gems/jruby-1.5.6/gems/rubygems-update-1.8.1/lib/rubygems.rb:1224
	from /home/john/.rvm/gems/jruby-1.5.6/gems/rubygems-update-1.8.1/lib/rubygems.rb:24:in `require'
	from setup.rb:24

 

这个应该是 gem 1.8.1 的 bug ,处理的方式是使用升级到 1.7.2 ,这个需要手工完成:

# 下载 http://production.cf.rubygems.org/rubygems/rubygems-update-1.7.2.gem 然后执行下面的命令
$ gem install --local ./rubygems-update-1.7.2.gem 
Successfully installed rubygems-update-1.7.2
1 gem installed
Installing RDoc documentation for rubygems-update-1.7.2...
$ update_rubygems 
RubyGems 1.7.2 installed

=== 1.7.2 / 2011-04-05

* 1 Bug Fix:
  * Warn on loading bad spec array values (ntlm-http gem has nil in its cert
    chain)


------------------------------------------------------------------------------

RubyGems installed the following executables:
	/home/john/.rvm/rubies/jruby-1.5.6/bin/jgem

$ gem -v
1.7.2

 

(这篇博客的内容将被添加到之前的培训系列中)