Deploy JRuby web application with jetty-rackup

Powered by Jetty

I already reported about our problems with different Ruby libraries. Bad library support is the main cause, why in our current project we decided to switch from MRI to JRuby for all the new application development.

The tradition in the JRuby world is to do it the same way it is done in Java:

  • create a lengthy configuration in WEB-INF/web.xml
  • package everything to jars and wars
  • throw it in a servlet container - tomcat, jetty or glassfish

and all the howtos and tutorials assume that way.

The Ruby way, in my opinion, is to use Rack and a rackup script. So I wanted to “invert the control” and embed a Java web server inside my Ruby script. That way is also supported by the Java’s light weight web server jetty.

So I ported rackup and adapted it for the usage with jetty. You can install it from github. Now you can take your existing, say Sinatra, application and reuse your existing config.ru

Enjoy!

Comments

blog comments powered by Disqus