How do you update JRuby's gem command?

青春壹個敷衍的年華 提交于 2019-12-07 10:02:55

问题


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

回答1:


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.




回答2:


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


来源:https://stackoverflow.com/questions/6769910/how-do-you-update-jrubys-gem-command

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!