How can I run JRuby on Rails from Java?

I need to run a copy of a Rails application from Java. I would prefer a lightweight HTTP server as our installations will have a very small user base (1-10, 10 is a huge installation).

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

Any tips for running Rails this way? I really don't need a separate Tomcat server.

Thank!

+2


source to share


2 answers


You can simply create war files for each installation (google for "warbler") and serve them through a single tomcat, or use a jetty for each installation (which might be slightly lighter than tomcat, depending on your configuration).



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

+1


source


The easiest way that comes to mind is to make a shell call like

jruby script/server

      



... from you Java application.

+1


source







All Articles