Thursday, June 9, 2011

Solution to jruby bug# 5730 - gem update --system fails

http://jira.codehaus.org/browse/JRUBY-5730


ashee:hooks amitava$ ruby --version
jruby 1.6.2 (ruby-1.9.2-p136) (2011-05-23 e2ea975) (Java HotSpot(TM) 64-Bit Server VM 1.6.0_24) [darwin-x86_64-java]
ashee:hooks amitava$ gem update --system
Updating RubyGems
ERROR: While executing gem ... (NoMethodError)
undefined method `version' for nil:NilClass
ashee:hooks amitava$ gem update --system -V --backtrace
Updating RubyGems
ERROR: While executing gem ... (NoMethodError)
undefined method `version' for nil:NilClass
/Users/amitava/.rvm/rubies/jruby-1.6.2/lib/ruby/site_ruby/1.8/rubygems/commands/update_command.rb:137:in `update_rubygems'
/Users/amitava/.rvm/rubies/jruby-1.6.2/lib/ruby/site_ruby/1.8/rubygems/commands/update_command.rb:54:in `execute'
/Users/amitava/.rvm/rubies/jruby-1.6.2/lib/ruby/site_ruby/1.8/rubygems/command.rb:278:in `invoke'
/Users/amitava/.rvm/rubies/jruby-1.6.2/lib/ruby/site_ruby/1.8/rubygems/command_manager.rb:133:in `process_args'
/Users/amitava/.rvm/rubies/jruby-1.6.2/lib/ruby/site_ruby/1.8/rubygems/command_manager.rb:103:in `run'
/Users/amitava/.rvm/rubies/jruby-1.6.2/lib/ruby/site_ruby/1.8/rubygems/gem_runner.rb:63:in `run'
/Users/amitava/.rvm/rubies/jruby-1.6.2/bin/gem:25:in `(root)'


rvm install jruby does not install the rubygems-udpate gem on which gem update --system relies on.

Just install rubygems-update and re-run gem update --system


ashee:~ amitava$ gem install rubygems-update
Fetching: rubygems-update-1.8.5.gem (100%)
Successfully installed rubygems-update-1.8.5
1 gem installed
ashee:~ amitava$ gem update --system
Updating RubyGems
Updating RubyGems to 1.8.5
Installing RubyGems 1.8.5
RubyGems 1.8.5 installed

=== 1.8.5 / 2011-05-31

* 2 minor enhancement:

* The -u option to 'update local source cache' is official deprecated.
* Remove has_rdoc deprecations from Specification.

* 2 bug fixes:

* Handle bad specs more gracefully.
* Reset any Gem paths changed in the installer.


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

RubyGems installed the following executables:
/Users/amitava/.rvm/rubies/jruby-1.6.2/bin/jgem

ashee:~ amitava$

No comments: