How do you update JRuby's gem command?
How do we update the version of gem that JRuby uses?
JRuby uses gem (1.5.1) and we would like to upgrade it to 1.8.7. We want to have the gems installed in Ruby/gems
We run:
bin/jruby gem install rubygems-update
Fetching: rubygems-update-1.8.5.gem (100%)
Successfully installed rubygems-update-1.8.5
1 gem installed
bin/jruby gem install --system
ERROR: While executing gem ... (OptionParser::InvalidOption)
invalid option: --system
(update does not work either)
bin/jruby gem update --system
Updating RubyGems
Updating RubyGems to 1.8.5
Installing RubyGems 1.8.5
ERROR: While executing gem ... (Errno::EBADF)
Bad file descriptor - Bad file descriptor
How can the install/update of gem (1.8.5) be done?
Configuration:
- using Maven to install JRuby.
- JRuby is installed at: ~/.m2/repository/org/jruby/jruby-complete/1.6.3/jruby-complete-1.6.3.jar
- jruby-complete-1.6.3.jar is NOT exploded.
- jruby-complete-1.6.3.jar has built the "gem" (1.5.1) command into it开发者_开发知识库.
- command
bin/jruby
that looks like this:
(bin/jruby)
export jruby_build=1.6.3
export GEM_HOME= ~/tools/ruby/gems
java -jar ~/.m2/repository/org/jruby/jruby-complete/${jruby_build}/jruby-complete-${jruby_build}.jar -S $*
- Environment variables:
(env)
GEM_HOME=~/tools/ruby/gems
GEM_PATH=~/tools/ruby/gems
If you can get update_rubygems to work, that's fine, but be aware that this may cause some JRuby-specific extensions to no longer work (e.g., maven integration). We ship RubyGems with JRuby releases so that we can ensure our extensions are compatible with the version we ship.
Having installed rubygems-update
, you then need to execute the command:
jruby -S update_rubygems
From then on, you should be able to use the normal command, i.e.
jruby -S gem update --system
精彩评论