How run JRuby from a Warbler war

I have a Rails application bundled up via Warbler.

I looks like the lib folder contains the JRuby code in jar files.

How can I run jruby commands using these jar files so that I can run
rake tasks (like db:migrate) on my app server without having to also
install JRuby binaries somewhere else on the server?

Of course its not a huge deal to also install JRuby but since the
binaries are already in the war it would be nice to run right from that.

Thanks in advance.

Actually I don’t remember what warbler installs into the lib directory,
but
if you have jruby-complete.jar you can execute this:

java -jar lib/jruby-complete.jar -S rake db:migrate

Cheers

On Mon, Jan 18, 2010 at 2:22 PM, Homer S. [email protected]
wrote:

I have a Rails application bundled up via Warbler.

I looks like the lib folder contains the JRuby code in jar files.

How can I run jruby commands using these jar files so that I can run
rake tasks (like db:migrate) on my app server without having to also
install JRuby binaries somewhere else on the server?

Hmm…interesting idea. I think it would make a good feature request;
perhaps after warbling for the first time, warbler can use the jruby
bits it installs for running things? Or perhaps jruby could get
installed as a plugin so the entire app is free-standing?

As of right now, I think it would be possible to make it work, but
tricky. JRuby still wants to know where gems are installed, where the
jruby root location is, etc.

  • Charlie

To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

On Fri, Jan 22, 2010 at 2:01 PM, Homer S. [email protected]
wrote:

However when I run:

java -jar /opt/jruby/jruby-complete-1.4.0.jar -J-Xmx2048m -S rake
some:task

I get this following error:
jruby: unknown option -J-Xmx2048m

Any idea why?

You need to supply them directly to java, like this:

java -Xmx2048m -jar /opt/jruby/jruby-complete-1.4.0.jar -S rake


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

David C. wrote:

Actually I don’t remember what warbler installs into the lib directory,
but
if you have jruby-complete.jar you can execute this:

java -jar lib/jruby-complete.jar -S rake db:migrate

Cheers

jruby-complete works well for migrates. I have a problem running other
tasks that need more memory though. The following works with jruby
installed:

jruby -J-Xmx2048m -S rake some:task

However when I run:

java -jar /opt/jruby/jruby-complete-1.4.0.jar -J-Xmx2048m -S rake
some:task

I get this following error:
jruby: unknown option -J-Xmx2048m

Any idea why?

On Jan 22, 2010, at 7:01 AM, Homer S. wrote:

I get this following error:
jruby: unknown option -J-Xmx2048m

Any idea why?

-J is a JRuby option which passes the argument to JVM. Try

java -Xmx2048m -jar /opt/jruby/jruby-complete-1.4.0.jar -S rake -T


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs