I could see making the 'env' change, but so far we have been unable to
get a fully-functional sh-based 'jruby' executable. There's enough
bashisms we depend on that it's hard to make a conversion...and sadly
we're not sh experts, so we don't know the right way to make it
happen.

If there are sh experts out there, we would appreciate help coming up
with a portable sh-based 'jruby' script. We have a start, in jruby.sh
(may or may not be in the distributions), but it's missing things from
the bash version: cygwinisms, proper quoting of arguments, and so on.
I attempted to fix the quoting, but it seems sh is simply crippled
here, lacking the bash arrays we use for processing arguments. Help is
needed.

https://github.com/jruby/jruby/blob/master/bin/jruby.sh

The alternative which may help many of you would be to install the
'jruby-launcher' gem. This is a native executable that downloads,
installs, and replaces the 'jruby' command with a real binary. It
should route around any issues with bash, env, or sh.

- Charlie

On Fri, Jan 14, 2011 at 5:57 PM, Stu <stu / rubyprogrammer.net> wrote:
> I agree! I didn't look at the script to see if it had any bashisms.
> /bin/sh would definitely be welcome and by all means the most
> portable.
>
> btw. /bin/bash definitely screws up rvm installed jruby in freebsd.
>
> example:
>
> % uname -a
> FreeBSD hal9000.rubyprogrammer.net 8.1-RELEASE FreeBSD 8.1-RELEASE #2:
> Thu Aug 12 17:55:19 CDT 2010
> v0id / hal9000.rubyprogrammer.net:/usr/obj/usr/src/sys/HAL9000 amd64
>
> % rvm list
>
> rvm rubies
>
>  ruby-1.8.7-head [ x86_64 ]
> => ruby-1.9.2-head [ x86_64 ]
>  rbx-head [ ]
>  ree-head [ x86_64 ]
>  ree-1.8.7-2010.02 [ x86_64 ]/home/stu/.rvm/scripts/list:
> /home/stu/.rvm/rubies/jruby-1.5.5/bin/ruby: /bin/bash: bad
> interpreter: No such file or directory
>
>  jruby-1.5.5 [ ]
>
> This is a bug. It should be fixed.
>
> ~Stu
>
>
> On Fri, Jan 14, 2011 at 4:50 PM, Oliver Schad
> <spam.entfernen.und.bring.gefaelligst.ein.bier.mit / oschad.de> wrote:
>> Stu wrote:
>>
>>> Hey support #!/usr/bin/env bash vs the non portable /bin/bash. not all
>>> OSes put bash there.
>>
>> Not all OS have a bash. /bin/sh is existent per definition and portable.
>>
>> Regards
>> Oli
>>
>> --
>> Man darf ruhig intelligent sein, man muss sich nur zu helfen wissen
>>
>>
>
>