Upgrading released JRuby versions to rubygems 1.2

Hi folks,

By now you’ve probably heard some good news about rubygems 1.2, about
its major speed up and significant reduction of memory requirements
(for me the memory use dropped from 600Mb to 40Mb!). JRuby 1.1.3 will
come with rubygems 1.2. But chances are you tried to upgrade your
previously released version of JRuby with new rubygems.

There are a couple of issues to be aware if you’d like to upgrade the
rubygems manually. Historically, JRuby has always had a small
number of customization/patches oven the stock rubygems and upgrading
to the stock version of rubygems 1.2 will remove them. See below on
how this is going to be resolved going forward.

  1. jruby -S gem update --system - this standard command to upgrade
    the rubygems just doesn’t work with JRuby 1.1.2,
    due to bug in rubygems 1.1.1. Luckily, there is a workaround:

    jruby -S gem install rubygems-update -v 1.1.1

    Once this update is installed, then proceed with the main update
    command listed above.

  2. IMPORTANT: There are some incompatible changes in stock rubygems
    1.2, the most important one is
    the change of the place where the gems are stored.
    If you invoke jruby -S gem env, look at GEM PATHS value (it will
    have something like jruby-1.1.2/lib/jruby,
    instead of previous location: jruby-1.1.2/lib/ruby, basically
    gems will be in lib/jruby subdir instead of lib/ruby one).

    As a result, once you upgrade, your previously installed gems
    “disappear”, since they are in the old place.

Luckily, rubygems 1.2 provides some new means to customize the
behavior depending on Ruby implementation, looking
into #{RUBY_ENGINE}.rb file, in JRuby case that would be jruby.rb.

I strongly encourage you to pick jruby.rb file from the subversion
repository and place where needed: in
YOUR_JRUBY_DIR/lib/ruby/site_ruby/1.8/rubygems/defaults/jruby.rb

The content of the file can be obtained here:
http://svn.jruby.codehaus.org/browse/~raw,r=7035/jruby/trunk/jruby/lib/ruby/site_ruby/1.8/rubygems/defaults/jruby.rb

To verify that the file is in proper location, invoke jruby -S gem env
and take a look at GEM PATHS value, it should be back
to lib/ruby/gems, and also verify that RUBY EXECUTABLE is jruby.bat,
not jruby.bat.exe (on Windows).

  1. Process.uid raises an exception on Windows, but this method is
    needed by rubygems 1.2.
    Again, if you have obtained jruby.rb file from above, this issue
    should be resolved.

Thanks,
–Vladimir


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

Thanks very much for the walkthrough and update, Vladimir. I’ve started
including RubyGems 1.2 as a 1.1.3 bullet in my talks here.

Vladimir S. wrote:

number of customization/patches oven the stock rubygems and upgrading
command listed above.
“disappear”, since they are in the old place.
http://svn.jruby.codehaus.org/browse/~raw,r=7035/jruby/trunk/jruby/lib/ruby/site_ruby/1.8/rubygems/defaults/jruby.rb

Thanks,
–Vladimir


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email