Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Won't Fix
-
Affects Version/s: JRuby 1.0.0RC2
-
Fix Version/s: None
-
Component/s: None
-
Labels:None
-
Environment:Linux cat-in-the-hat 2.6.21-1-686 #1 SMP Sat May 26 16:14:59 UTC 2007 i686 GNU/Linux
(Debian using official packages from Debian unstable)
-
Number of attachments :
Description
Issue GROOVY-1936 (http://jira.codehaus.org/browse/GROOVY-1936) also applies to the JRuby interpreter. When using the interpreter in the shebang of one of my own scripts, Linux's recursive shebang handling is screwed up, so it tries to run my script in bash (rather than in jruby).
[bloom@cat-in-the-hat nouns]$ cat test.rb
#!/usr/bin/jruby1.0
puts "Hello"
[bloom@cat-in-the-hat nouns]$ ./test.rb
./test.rb: line 2: puts: command not found
The proper fix is to translate the jruby1.0 command to C, and to compile and install that on UNIX systems. Alternatively, speak to the linux-kernel mailing list about this, as I am uncertain whether this shebang handling behavior is a feature or a bug.
I haven't heard of such a thing done before – although it would be possible with the advent of openjdk to ship a native launcher specific to JRuby, we aren't really interested in doing that at the moment.
The usual workaround for this is to ensure /usr/bin is in your path and put
at the top of your script.