Forum: JRuby Is there an environment variable that will make gems available to scriptlets run through a Scripting

Posted by Jonathan Coveney (Guest)
on 2012-09-28 09:34
(Received via mailing list)
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.

Any ideas? Thanks
Jon
Posted by Jonathan Coveney (Guest)
on 2012-09-28 09:45
(Received via mailing list)
Argh, looks like JRUBY_HOME does the trick

2012/9/28 Jonathan Coveney <jcoveney@gmail.com>
Posted by Jonathan Coveney (Guest)
on 2012-09-28 09:52
(Received via mailing list)
Sorry for the spam! It looks like it does not, in fact, work. Back to
square one. Any help is appreciated.

2012/9/28 Jonathan Coveney <jcoveney@gmail.com>
Posted by kristian (Guest)
on 2012-09-28 10:02
(Received via mailing list)
what about to pack the gems into your jar (if you have such a jar) ?

for details see
http://yokolet.blogspot.in/2010/10/gems-in-jar-wit...

- Kristian
Posted by Jonathan Coveney (Guest)
on 2012-09-28 20:44
(Received via mailing list)
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.

2012/9/28 kristian <m.kristian@web.de>
Posted by Russell Jurney (Guest)
on 2012-09-28 22:04
(Received via mailing list)
What about bundler? This is what it's for, I think?

Russell Jurney http://datasyndrome.com

On Sep 28, 2012, at 11:43 AM, Jonathan Coveney <jcoveney@gmail.com> 
wrote:

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.

2012/9/28 kristian <m.kristian@web.de>
Posted by Robin McKay (robin2)
on 2012-09-29 10:25
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?
Posted by Theo (Guest)
on 2012-10-02 07:40
(Received via mailing list)
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...

T#
Posted by Jonathan Coveney (Guest)
on 2012-10-03 01:01
(Received via mailing list)
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...

2012/9/29 Robin McKay <lists@ruby-forum.com>
Please log in before posting. Registration is free and takes only a minute.
Existing account (Switch to SSL-encrypted connection)
NEW: Do you have a Google/GoogleMail or Yahoo account? No registration required!
Log in with Google account | Log in with Yahoo account
No account? Register here.