I have about 4-5 different jruby on rails projects that I am developing.
At
some point all of these applications need to run (mongrel at present) at
the
same time. I need to have a separate copy and, potentially, version of
jruby for each application as well as a different group of and versions
of
gems for each application.
On the server they run in different user accounts so PATH and JRUBY_HOME
is
distinct for each application.
How can I achieve this so that at runtime each app is using the correct
jruby? Is this about shells etc.
How can I achieve this so that at runtime each app is using the correct
jruby? Is this about shells etc.
P.S. Operating system is OSX leopard.
Any help appreciated.
Yeah, I can’t think of anything specific that JRuby can do to help you
manage this, it’s probably more about shell environments and keeping an
environment script per app.
Unless there are specific things requiring specific JRuby versions, you
might consider just “vendoring everything” (meaning store copies of all
gems
and dependencies in each app). This would allow you to use a single
JRuby
install to run all the applications.
I couldn’t think of anything either. I’m not going mad. As I said the
deployed apps are OK, its just on my dev machine where I need to mimic
the
server runtime setup.
I wanted reassurance that if the jruby command is run from a full path
and
not via a PATH search, that any thing done by the executable is done in
the
context of the path given to the command and not anything found on the
PATH.
Not knowing enough about jruby internals I suppose I need assurances on
the
following.
Path = /opt/lang/juby1.3.0/bin:/usr…
App 1 starts via /home/gb/dev/app1/lang/jruby1.1.1/bin/jruby
…/app/script/server
App 2 starts via /home/gb/dev/app2/lang/jruby1.1.2/bin/jruby
…/app/script/server
App 3 starts via /home/gb/dev/app3/lang/jruby1.1.3/bin/jruby
…/app/script/server
App 4 starts via /home/gb/dev/app4/lang/jruby1.1.4/bin/jruby
…/app/script/server
Is there a chance that any of the 4 processes might load things from
/opt/lang/jruby1.3.0/bin via the path?
context of the path given to the command and not anything found on the PATH.
The launcher scripts are specifically written to path out to …/lib for
all
JRuby files and Ruby libraries. The only exception is if JRUBY_HOME is
set.
So make sure you unset that variable if necessary, and then you should
be
fine using full paths to the jruby launcher script.
Hi Guy,
You can consider using some kind of virtualization, that would give
your apps total separation.
Right now i’m in the process of making 4 test servers out of my 1, and
i’ve choosen to use virtual systems for them.
I wanted reassurance that if the jruby command is run from a full path
set.
So make sure you unset that variable if necessary, and then you should be
fine using full paths to the jruby launcher script.