I installed JRuby 1.7.2 in RVM, created a gemset, executed bundle install. Now, I run this:
Term 1:
[lzap@lzapx my_app]$ bundle exec jruby --ng-serv
NGServer started on all interfaces, port 2113.
Term 2:
[lzap@lzapx my_app]$ JRUBY_OPTS="--1.9 --ng" bundle exec rails s
The issue is nothing happens, on both sides the terminals do not print anything, it just hangs forever. Top does not show any java/jruby processes working.
If I try to start the application without --ng, it works okay. What is the issue? Bundler?
Firewall is disabled of course.
One Nailgun Server
It's possible to generate a binstub for rails …
… and edit it to set the JRUBY_OPTS.
This way only the bundler-wrapped portion of the client is executed in the bundler-wrapped nailgun server.
Since nailgun doesn't propagate signals you might want to use a controller to stop it:
Benchmark:
Two Nailgun Servers
A second 'non-bundle-exec'ed server could be used in theory. To avoid explicit restarts but allow killing (with two Ctrl-C presses) I'd suggest this loop:
The port for the second nailgun instance has to be specified in the outside client:
I didn't see a performance improvement and the output appearing in the 'wrong' console is annoying. But maybe this is faster on other systems. And someone else might see a way improve this approach?