JRuby favours scripts on PATH

Hi
Firstly, thanks for JRuby!

I’m trying to use jruby-complete.jar for easy deployment of JRuby code.

I’ve boiled down my problem to this gist https://gist.github.com/3614674

From my understanding of the wiki etc (and my reading of the
ArgumentProcessor.resolveScript code) I’d expect JRuby to favour the gem
script inside the jruby-complete.jar at META-INF/jruby.home/bin/gem

Instead its favouring scripts found on PATH and I see:
I am not really gem
[“list”]

  1. Is my expectation/understanding correct? If so, is there something
    obvious I’m missing/doing wrong?
  2. If not, how can I get JRuby to use the internal gem script?

On my dev machine, JRuby run as “java -cp jruby-complete.jar
org.jruby.Main
-S gem list” always picks up rbenv’s gem script, which isn’t even ruby
(its
a shell script shim)
If I remove this shim script from the PATH, its just happening to work
because the next gem script it encounters (from MRI) works with JRuby.

In any case, cleaning the PATH is not really an option, as some scripts
need to find other commands via PATH (e.g. bundler needs git)

(I’ve replicated this on OS X apple java 1.6, oracle java 1.7 and linux
opensdk. JRuby 1.6.7, 1.6.7.2 and 1.7.0-preview2)

Any pointers in the right direction would be most appreciated!
thanks
:lachie

On Sep 4, 2012, at 8:58 PM, Lachie [email protected] wrote:

I am not really gem
(I’ve replicated this on OS X apple java 1.6, oracle java 1.7 and linux opensdk.
JRuby 1.6.7, 1.6.7.2 and 1.7.0-preview2)

Any pointers in the right direction would be most appreciated!
thanks
:lachie

I thought about this a bit, and I think this should be a bug. Could you
open a JIRA ticket? http://bugs.jruby.org

Thank you.

:lachie
http://smartbomb.com.au
http://www.flickr.com/photos/lachie/

On Wed, Sep 5, 2012 at 1:40 PM, Hirotsugu A.
[email protected]wrote:

From my understanding of the wiki etc (and my reading of the

Any pointers in the right direction would be most appreciated!
thanks
:lachie

I thought about this a bit, and I think this should be a bug. Could you
open a JIRA ticket? http://bugs.jruby.org

Thank you.

Done http://jira.codehaus.org/browse/JRUBY-6878
thanks!
:Lachie

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs