[Rubygems-developers] why rename gem to jgem for jruby?

Stephen Bannasch stephen.bannasch at deanbrook.org
Sun Apr 6 19:52:11 EDT 2008


Why is changing the name of the default exec format for the gem the default?

I separate all my Ruby installations so that the gems for 1.8, 1.9, and any of my JRuby installs are separate.

Updating to the latest rubygems installed gem as jgem in my JRuby install leaving the gem command that was here previously.

I've always recommended that people NOT mix gem installations in different versions of Ruby. In general how I accomplish that results in different bin directories for the different gem installs.

Gem.default_exec_format => => "j%s" on JRuby

There is this option:

  --no-format-executable

which would result in the new gem exec being named 'gem'.

I noticed this bug report:

[#16879] RubyGems should not install startup script as "jgem" by default on JRuby
http://rubyforge.org/tracker/index.php?func=detail&aid=16879&group_id=126&atid=575

Eric resolved it with this comment:

  It should not be the default, as that will break gem when multiple
  ruby implementations are installed.

Is this common.

I've been responding to people who ask why isn't every command prefixed with 'j' in JRuby like this -- am I wrong?

At 5:50 PM -0400 4/6/08, Stephen Bannasch wrote:
>At 8:47 AM +0000 4/6/08, M C wrote:
>>4) Please re-consider the naming of rake, spec, gem and ri tasks in the bin directory. I would like to co-exist with a normal ruby installation so the first thing I normally do after installing jruby is to rename them all to jrake, jspec, jgem, jri etc. so that I f.x. get MRI's gem when I type "gem" and jruby's gem when I type "jgem". The topic has been brought up before and I know there is resistance to this I just never understood why ?
>
>The renaming would have to be integrated into rubygems -- any gem can install a command line program so your list: jrake, jspec, jgem, jri ... etc would have to also include any other command line program installed by rubygems running under jruby -- jrails, jhaml ... etc.
>
>Some gems compile libraries as part of their install. Hpricot installed under MRI compiles native C libraries while under JRuby it uses a Java library distributed in a jar. In general once Gems that require native code (I'm included Java code as one of the native code examples) are installed they expect to only be used with that os/arch.
>
>Coexistence for me means that none of my MRI and JRuby gems or libraries overlap and that when I want to, for example run rake in JRuby I use: jruby -S rake.
>
>In the past when I wanted to work in JRuby I used to put the path JRUBY_HOME/bin as the first element in my $PATH environmental variable.  This would allow me to run  all the command line ruby programs installed by gems by just typing the names -- but it made it much harder to switch back and forth between C Ruby and JRuby.
>
>Now I use the guidelines described here:
>
>  http://wiki.jruby.org/wiki/Getting_Started
>



More information about the Rubygems-developers mailing list