I’ve run “gem install blah,” but I’m having trouble making those gems
available to a script being run in a ScriptingContainer. I’d prefer to
set
some sort of environment variable instead of adding things to the load
path
in java, if possible.
This is an idea people have mentioned before, and is what I wanted to do
originally… that’s a pretty good example. The annoying part is that
this
has to integrate with an existing project which has its own jar and
build
system, so I’d have to either integrate this with that, or make a new
jar
copying the old contents, with the gems I want. That’s not a horrible
idea,
I suppose. Hmm.
I haven’t used ScriptingContainer, but from reading about it I wonder
where it finds JRuby? And that made me wonder why you thought JRUBY_HOME
worked, and then concluded that it doesn’t. Perhaps it did work on the
occasion when it was pointing to the appropriate copy of JRuby - or when
the instance it pointed to was appropriate.
Is it possible to make the ScriptingContainer use a copy of JRuby that
is included in your project?
Check the value of the GEM_HOME environment variable, it’s used by
Rubygems to find where to find gems. If it’s not set, setting if might
help, but if it’s set then maybe the problem is harder…
This is an idea people have mentioned before, and is what I wanted to do
originally… that’s a pretty good example. The annoying part is that
this
has to integrate with an existing project which has its own jar and
build
system, so I’d have to either integrate this with that, or make a new
jar
copying the old contents, with the gems I want. That’s not a horrible
idea,
I suppose. Hmm.
So, it turns out JRUBY_HOME was correct, but I had some clashing jruby
installs or something. Once I cleaned that up, JRUBY_HOME properly set
it.
I think with Bundler it would be possible to push it all into the jar,
so
that everything comes within the jar. This is more jar wrangling than
I’d
like…