How to run nailgun with JRuby/RubyMine on Windows 7?


I have a problem running nailgun in Windows 7.

Here is what I do
in a command window
     jruby --ng-server
"NGServer started on all interfaces, port 2113."

in Rubymine 5, using JRuby-1.7.3, I add the --ng flag to my run configuration to the 'Ruby arguments' field.

when running the configuration, in the Run: window a tab appears named Nailgun Server with this message:

     C:/Ruby/JRuby173/bin/jruby.exe --ng-server
     NGServer started on all interfaces, port 2113.
     java.net.BindException: Address already in use: JVM_Bind
      at java.net.DualStackPlainSocketImpl.bind0(Native Method)
      at java.net.DualStackPlainSocketImpl.socketBind(Unknown Source)
      at java.net.AbstractPlainSocketImpl.bind(Unknown Source)
      at java.net.PlainSocketImpl.bind(Unknown Source)
      at java.net.ServerSocket.bind(Unknown Source)
      at java.net.ServerSocket.<init>(Unknown Source)
      at java.net.ServerSocket.<init>(Unknown Source)
      at com.martiansoftware.nailgun.NGServer.run(Unknown Source)
      at java.lang.Thread.run(Unknown Source)
     com.martiansoftware.nailgun.builtins.NGAlias: 0/0
     com.martiansoftware.nailgun.builtins.NGClasspath: 0/0
     com.martiansoftware.nailgun.builtins.NGServerStats: 0/0
     com.martiansoftware.nailgun.builtins.NGStop: 0/0
     com.martiansoftware.nailgun.builtins.NGVersion: 0/0
     NGServer shut down.

     Process finished with exit code 0

The configuration does run to completion after a while, but not at nailgun speed.
(I ran the same configuration on my OSX system, and there nailgun runs fine, with considerable reduction of start up time)

The above suggests that Rubymine attempts to launch another nailgun server instance,
so I tried to run the configuration from rubymine without launching a nailgun server from the command line first.

Indeed the first run of the configuration is OK
the second run of the configuration results in the same message as above.

So it seems that the nailgun server is good for only one run, which sort of defeats the purpose of nailgun.

How to remedy this?



Please sign in to leave a comment.