Hi,
I deliver a Rails project to my client as a single WAR-package. It
works great, the client does not need to install anything but the JEE
servers they already have.
Now, I need to set up a cron task that can be run using with the
following script:
export RAILS_ENV=production
export CLASSPATH=./lib/ojdbc14.jar
export GEM_PATH=./gems/
jruby -S script/runner “Nightly.run”
It works fine, but requires the client to install jruby. Much nicer
solution would use the jruby bundled within the war package. I could
not get it working, because I will get:
Rails requires RubyGems >= . Please install RubyGems and try again:
http://rubygems.rubyforge.org
The script I use:
export RAILS_ENV=production
export CLASSPATH=./lib/ojdbc14.jar:./lib/jruby-complete-1.1.4.jar
export GEM_PATH=./gems/
java org.jruby.Main -w -S script/runner “Nightly.run”
I also tried:
java -jar /lib/jruby-complete-1.1.4.jar -S script/runner
“Nightly.run”
But the same error occurs (and I cannot use environment variables at
all with the -jar option)
I’m sure there’s the solution, but cannot figure out what is is. Any
ideas?
-harri.
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email
On Wed, Mar 4, 2009 at 12:18 AM, Harri Kauhanen
[email protected] wrote:
export CLASSPATH=./lib/ojdbc14.jar
The script I use:
But the same error occurs (and I cannot use environment variables at all
with the -jar option)
I’m sure there’s the solution, but cannot figure out what is is. Any ideas?
If you can, upgrade to jruby-complete-1.1.6.jar. It will detect
rubygems out of the complete jar automatically. Otherwise, your runner
scripts look pretty reasonable to me.
/Nick
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email
If I use jruby-complete-1.1.6.jar with…
java org.jruby.Main -w -S script/runner "Nightly.run"
…I will get something like this (did not happen with 1.1.4)…
:1: ./script/runner:1: unknown regexp options - rr (SyntaxError)
…but if I use…
java -jar /lib/jruby-complete-1.1.4.jar -S script/runner
“Nightly.run”
…it seem to load Rails gems, great! I will encounter another
problem, however:
The driver encountered an error: cannot load Java class
oracle.jdbc.OracleDriver
So it does not find the jar I defined in the CLASSPATH.
More ideas?
-harri.
On Mar 4, 2009, at 15:22 , Nick S. wrote:
Now, I need to set up a cron task that can be run using with the
would use the jruby bundled within the war package. I could not get
export GEM_PATH=./gems/
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email
On Wed, Mar 4, 2009 at 6:18 AM, Harri Kauhanen
[email protected] wrote:
export CLASSPATH=./lib/ojdbc14.jar
export GEM_PATH=./gems/
jruby -S script/runner “Nightly.run”
It might be a bit heavyweight for your needs, but in my project I’ve
used the Quartz Scheduler to do this entirely within the container.
http://www.opensymphony.com/quartz/
I used the quartz-jruby-plugin from here to hook it into Rails:
http://github.com/macarthy/mirror-quartz-jruby-plugin/tree/master
You specify cron-like schedules and commands to be run in your
web.xml.erb, and it all gets bundled up correctly by Warbler.
Chris.
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email
On Wed, Mar 4, 2009 at 8:15 AM, Harri Kauhanen
[email protected] wrote:
If I use jruby-complete-1.1.6.jar with…
java org.jruby.Main -w -S script/runner "Nightly.run"
…I will get something like this (did not happen with 1.1.4)…
:1: ./script/runner:1: unknown regexp options - rr (SyntaxError)
An odd error. Just for kicks can you try it without -S? I.e., `java
org.jruby.Main -w script/runner “Nightly.run”'.
So it does not find the jar I defined in the CLASSPATH.
Yes. CLASSPATH is unfortunately ignored when using the -jar form. You
can add the driver to the load path like so:
java -jar /lib/jruby-complete-1.1.4.jar -r./lib/ojdbc14.jar
script/runner “Nightly.run”
/Nick
[email protected] wrote:
script:
I also tried:
rubygems out of the complete jar automatically. Otherwise, your runner
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email
On Wed, Mar 4, 2009 at 6:54 PM, Ikai L. [email protected] wrote:
Chris, I don’t think this code will work with a new version of Jruby. I do
remember some chatter a while back about some work that was being put into
updating Jruby-quartz.
Recent as in 1.1.6, or more recent than that? I definitely have
something based on that code working on 1.1.6 now, though I think I
made some minor local modifications - would have to check.
Here’s the Github repo of Christian Müller’s Quartz Scheduler, updated to
work with recent versions of JRuby:
http://github.com/muellerc/quartz_scheduler/tree/master
Shall take a look, thanks! At some point I do want to get the
clustered scheduler mode to work, so I’ll have to look at this again.
Chris.
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email
Chris, I don’t think this code will work with a new version of Jruby. I
do
remember some chatter a while back about some work that was being put
into
updating Jruby-quartz.
Here’s the Github repo of Christian Müller’s Quartz Scheduler, updated to
work with recent versions of JRuby:
http://github.com/muellerc/quartz_scheduler/tree/master
Ikai
On 3/4/09 9:22 AM, “Chris A.” [email protected] wrote:
I used the quartz-jruby-plugin from here to hook it into Rails:
http://xircles.codehaus.org/manage_email
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email
I’ve never had this working on anything more recently than 1.0.1. I
think
the way it uses getRuby() changed and broke the Java part of
jruby_quartz.
Ikai
On 3/4/09 12:02 PM, “Chris A.” [email protected] wrote:
work with recent versions of JRuby:
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email