如何更新 JRuby 的 gem 命令?
我们如何更新 JRuby 使用的 gem 版本?
JRuby 使用 gem (1.5.1),我们想将其升级到 1.8.7。我们想要将 gems 安装在 Ruby/gems 中
我们运行:(
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
更新也不起作用)
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
如何安装/更新 gem (1.8.5)?
配置:
- 使用Maven安装JRuby。
- JRuby 安装在: ~/.m2/repository/org/jruby/jruby-complete/1.6.3/jruby-complete-1.6.3.jar
- jruby-complete-1.6.3.jar 未分解。
- jruby-complete-1.6.3.jar 已内置“gem”(1.5.1)命令。
- 命令
bin/jruby
如下所示:
(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 $*
- 环境变量:
(env)
GEM_HOME=~/tools/ruby/gems
GEM_PATH=~/tools/ruby/gems
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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果您可以让 update_rubygems 工作,那很好,但请注意,这可能会导致某些特定于 JRuby 的扩展不再工作(例如,maven 集成)。我们随 JRuby 版本一起发布 RubyGems,以便确保我们的扩展与我们发布的版本兼容。
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.
安装完 rubygems-update 后,您需要执行命令:
从那时起,您应该可以使用正常命令,即
Having installed
rubygems-update
, you then need to execute the command:From then on, you should be able to use the normal command, i.e.