JRuby with Nailgun
From JRubyWiki
JRuby supports execution with Nailgun. Nailgun allows you to start up a single JVM as a background server process and toss it commands from a fast native client. To use Nailgun with JRuby:
- Check out JRuby trunk at http://svn.codehaus.org/jruby/trunk/jruby
- Navigate to your checkout directory and run
antto build JRuby - Run
ant jruby-nailgunto build the native binary and the modified jar file that includes Nailgun - Start up a server with jruby-ng-server
- background it using
$JRUBY_HOME/bin/jruby-ng-server > /dev/null 2> /dev/null &
- background it using
- You can now run JRuby commands through that server using the
jruby-ngcommand instead ofjruby
There are a few known issues with Nailgun (looking for fixes, possibly will need work on Nailgun itself):
- Signals are not propagated through to the JRuby instances in the NG server. This prevents using Control-C to terminate NG-based commands.
- Runtimes started through NG that spin up threads will not completely shut down since the JVM is still running and the threads will continue executing after the main command shuts down.
NG support is mostly considered experimental, but if people are interested in it becoming a stable, supported features they can help us by providing feedback.

