From: Jeremy Tregunna Date: 2005-05-30T14:04:06+09:00 Subject: Re: How to find ruby? On 29-May-05, at 7:05 PM, Mark Probert wrote: > > Hi .. > > I am not sure of the best way of going about finding the location of > Ruby for > a shebang line (*nix execution). > > My scripts don't always have control of where Ruby might be installed > (that is > the provenance of the destination organization's sysadmin). Some > examples > that I have run across include > > /usr/local/bin/ruby > /usr/bin/ruby > /opt/ruby1.8/bin/ruby > etc. > > So, what do other people normally do when they have this kind of > situation > when it comes to the shebang line? I'd rather do it in some generic > manner > rather than have a substitution script run at install time (though > that is an > option). Most modern shells will accept multiple arguments on a shebang line (some older shells won't, but you shouldn't have a problem). Use: #!/path/to/env ruby where /path/to/env is the location of env(1) (usually /usr/bin). > -mark. (probertm at acm dot org) -- Jeremy Tregunna jtregunna@blurgle.ca