Alex Rivera | Logout

Is it possible to compile a Rails app to a Java VM JAR file?

Asked 2008-09-24T18:51:12.893
12

Essentially the only thing I can deploy to my deployment machine is a JAR file. I can't install JRuby, nor can I install Glassfish or Tomcat.

Is it possible to package up a Rails application (including Rails, vendored, of course) to a JAR file such that I can do

c:\my_server> java rails_app.jar

and have it run WEBRick or Mongrel within the JVM?

Edit
Report

2 Answers

3

It may be a bit dated, but Nick Sieger, one of the JRuby contributors wrote about warbler a while ago.

Warbler is about packaging a Rails app into a .war file. Now I'm not a big Java guy, so I'm not sure where your .jar restriction comes from. war files are similar to jars but they're for whole websites or something.

Worst case, I'm pretty sure the JRuby wiki has something about the state of packaging Rails apps to be run on Java architectures. It's in their best interest to have info about that.

answered 2008-09-25T02:32:07.043
1

you might want to try asking this question on the JRuby mailing list/forum(http://xircles.codehaus.org/lists/user@jruby.codehaus.org).

Another place someone would have done the same is the glassfish mailing list

Yet another thing you might want to do is to bundle winstone embeddable servlet container AND jruby AND rails and use jarjar to create one big jar. You might be able to build an ant build file to build such a BIG jar that also includes your rails application. One project that used this approach is hudson(https://hudson.dev.java.net/) -- you may get some info on how to go about doing that.

BR,
~A

answered 2008-09-24T20:14:17.077

Your Answer