Jruby can't find gem executables

I have a clean install of jruby installed in my local directory, with
a local directory to hold my gems. I’ve exported both GEM_HOME and
GEM_PATH to this local directory, and it shows correctly when I run
“jruby -S gem env”. I successfully ran “jruby -S gem install rails”,
and it installed the gems in the local directory.

When I run “jruby -S rails new test_app”, I get the error “jruby: No
such file or directory – rails (LoadError)”. The same thing if I
rund any of the gem executables. If I manually add the local
jruby_gems/bin to my PATH, it works correctly.

Where should it be picking up the gem executable directory, and any
thoughts on why it can’t see it?


I think RubyGems expects you to add $GEM_HOME/bin to your path when
you set it. It just happens that the default bin directory when
GEM_HOME is not set is the same one where the JRuby executable is.


I’m not sure if MRI behaves this way…