Search code examples
javajrubyjrubyonrails

How can I start JRuby on Rails from Java?


I need to start a copy of a Rails app from within Java. I would favor a lightweight HTTP server, as our installations will have a very small userbase (1-10, 10 being a huge installation).

My design I am aiming for is for a single process, with the web interface written in Rails - running on JRuby in a background thread of the main server written in Java.

Any tips on starting up Rails in this way? I very much don't want a separate Tomcat server running.

Thanks!


Solution

  • You could just create war files for every installation (google for "warbler") and serve them through one tomcat, or use jetty for each installation (which can be a little more lightweight than tomcat, depending on your configuration).

    As far as I know, you can even run script/server via jruby (which starts webrick through jruby).