On UNIX, you should be able to just type ‘make’ and a ‘jruby’ binary
will be created in the project directory. Copy this to
$JRUBY_HOME/bin. On Windows, you should also be able to type ‘make’ if
you have the MinGW compiler toolkit installed.
Ok. But I really don’t understand how it can solve the problem with nailgun.
Nailgun is supposed to be part of jruby.
Yes and no. We distribute the files, but on non-Windows machines, it
needs to be compiled.
I already have JRuby installed via RVM. So what kind of problem jruby-launcher
is supposed to solve for me?
“jruby” command is really a shell script if you don’t install
‘jruby-launcher’. My guess was that you are seeing the problem with the
shell script.
Anyway, I tried to install it (using RubyGems), but got the errors that seem to
be RSpec failures.
Here is one example of that failure:
JRuby native launcher should complain about a missing classpath append
argument
Failure/Error: jruby_launcher(“-Xcp:a 2>&1”).should =~ /Argument is
missing/
expected: /Argument is missing/
got: “/bin/sh:
/Users/dnagir/.rvm/gems/jruby-1.6.5/gems/jruby-launcher-1.0.9-java/build/home/bin/jruby:
Permission denied\n”
Looks like the problem persisted to this as well. Can you try installing
JRuby binary without RVM?
I suspect that the problem is really coming from RVM. I remember that
with a certain version of RVM it had a lot of trouble with compiling
naigun. I don’t remember the details, and I don’t know if it is still
the problem with most recent version of RVM. But if JRuby works if you
don’t use RVM, I must say that the problem lies with RVM.
Looks like the problem persisted to this as well. Can you try installing JRuby
binary without RVM?
I suspect that the problem is really coming from RVM. I remember that with a
certain version of RVM it had a lot of trouble with compiling naigun. I don’t
remember the details, and I don’t know if it is still the problem with most recent
version of RVM. But if JRuby works if you don’t use RVM, I must say that the
problem lies with RVM.
What kind of problem are you talking about?
I definitely don’t want to deal with system jruby. RVM does the job
amazingly well without any sudo permissions.
Here’s some steps to verify whether --ng-server is working for your environment
or not:
Thanks. I could start nail gun with plain jruby. The problem was that I
had “-X-C” in the JRUBY_OPTIONS.
And this is apparently invalid (despite Improving startup time · jruby/jruby Wiki · GitHub see Disable
JIT) because jruby errors out with:
Exception in thread “main” java.lang.NumberFormatException: For input
string: “-X-C”
at
java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)
at java.lang.Integer.parseInt(Integer.java:449)
at java.lang.Integer.parseInt(Integer.java:499)
at com.martiansoftware.nailgun.NGServer.main(Unknown Source)
Now I really do want to make it work with RVM.
The fact that it throws java.net.UnknownHostException when using with
RVM is just a bit wrong.
Why does it matter how nailgun is run to resolve the hostname?
On Sat, Dec 10, 2011 at 7:10 AM, Dmytrii N. [email protected]
wrote:
I definitely don’t want to deal with system jruby. RVM does the job amazingly
well without any sudo permissions.
Wellll… here’s a different issue than yours, but definitely showing
different behavior using RVM:
07:33 ~ $ rvm use system
Now using system ruby.
07:33 ~ $ jruby -v
jruby 1.6.5 (ruby-1.9.2-p136) (2011-10-25 9dcd388) (Java HotSpot™
64-Bit Server VM 1.6.0_29) [darwin-x86_64-java]
07:33 ~ $ JRUBY_OPTS=’ --1.9’
07:33 ~ $ jruby --ng-server
NGServer started on all interfaces, port 2113.
^Ccom.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
org.jruby.util.NailMain: 2/0
NGServer shut down.
07:57 ~ $ rvm use jruby-1.6.5
Using /Users/hassan/.rvm/gems/jruby-1.6.5
07:57 ~ $ echo $JRUBY_OPTS
–1.9
07:57 ~ $ jruby --ng-server
Exception in thread “main” java.net.UnknownHostException: --1.9
at java.net.Inet6AddressImpl.lookupAllHostAddr(Native Method)
at java.net.InetAddress$1.lookupAllHostAddr(InetAddress.java:849)
at
java.net.InetAddress.getAddressFromNameService(InetAddress.java:1202)
at java.net.InetAddress.getAllByName0(InetAddress.java:1153)
at java.net.InetAddress.getAllByName(InetAddress.java:1083)
at java.net.InetAddress.getAllByName(InetAddress.java:1019)
at java.net.InetAddress.getByName(InetAddress.java:969)
at com.martiansoftware.nailgun.NGServer.main(Unknown Source)
07:57 ~ $
So it might be worth trying without RVM. You don’t need to install it
with root permissions if you don’t want.
I definitely don’t want to deal with system jruby. RVM does the job amazingly
well without any sudo permissions.
You have to understand that RVM had issues with nailgun in the past.
Nailgun is not part of core JRuby and JRuby depends on how projects like
RVM package/install/set it up. We once have spent weeks investigating
sporadic JRuby failures across all projects on travis-ci.org that used
JRuby. It turned out to be an RVM-specific issue.
So download JRuby distribution and try with it. It won’t require sudo
permissions, take 5 minutes to try and will tell for sure whether it is
a yet another RVM-specific problem.
You have to understand that RVM had issues with nailgun in the past. Nailgun is
not part of core JRuby and JRuby depends on how projects like RVM
package/install/set it up. We once have spent weeks investigating sporadic JRuby
failures across all projects on travis-ci.org that used JRuby. It turned out to be
an RVM-specific issue.
That’s a bit weird. I can’t believe I’m the only one who’s using JRuby
nailgun with RVM.
But I’ll head to the RVM mailing list…
Exception in thread “main” java.lang.NumberFormatException: For input string:
“-X-C”
at
java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)
at java.lang.Integer.parseInt(Integer.java:449)
at java.lang.Integer.parseInt(Integer.java:499)
at com.martiansoftware.nailgun.NGServer.main(Unknown Source)
It is not JRuby that errors out, it is NGServer that tries to parse a
number (probably port number) and it is passed as “-X-C” which
java.lang.Integer.parseInt cannot handle (obviously).
So something in the RVM case incorrectly passes command line arguments
related to Nailgun.
On Sat, Dec 10, 2011 at 10:30 AM, Dmytrii N. [email protected]
wrote:
The fact that it throwsjava.net.UnknownHostException when using with RVM is
just a bit wrong.
Why does it matter how nailgun is run to resolve the hostname?
Good question. The RVM version is apparently interpreting my ’ --1.9’
in JRUBY_OPTS as a host; why, I have no idea
Unfortunately, other tasks are calling, will have to dig into this
later.