JRuby Part III – Upgrading Gems

Upgrading rubygems is extremely simple. All you have to do is:


sudo jgem install rubygems-update
sudo jruby -S update_rubygems
sudo jruby -S gem update

It brought my gem to version 1.3.1, just the same as my normal gem. However, jgem command no longer worked. It gave me following error:


/opt/jruby/bin/jgem: line 8: require: command not found
/opt/jruby/bin/jgem: line 9: require: command not found
/opt/jruby/bin/jgem: line 10: require: command not found
/opt/jruby/bin/jgem: line 12: required_version: command not found
/opt/jruby/bin/jgem: line 14: unless: command not found
/opt/jruby/bin/jgem: line 15: abort: command not found
/opt/jruby/bin/jgem: line 16: end: command not found
/opt/jruby/bin/jgem: line 21: syntax error near unexpected token `('
/opt/jruby/bin/jgem: line 21: `args = !ARGV.include?("--") ? ARGV.clone : ARGV[0...ARGV.index("--")]'

After taking a look at jgem itself, it appears that changing the first line from

#!/opt/jruby-1.1.4/bin/jruby

to

#!/usr/bin/env /opt/jruby-1.1.4/bin/jruby

fixes the problem. jgem command now works great.

Upgrading JRuby’s gem to 1.3.1 now allows me to install merb without a hitch. I haven’t tested it, but at least everything installed without barfing.

Comments

Comments are closed.

Powered by Olark