From: Jim Freeze Date: 2002-11-19T07:01:29+09:00 Subject: Re: install.rb/setup.rb question On Tuesday, 19 November 2002 at 6:29:36 +0900, Phil Tomson wrote: > In article <20021118153749.A13574@freeze.org>, > Jim Freeze wrote: > >On Tuesday, 19 November 2002 at 5:09:27 +0900, Phil Tomson wrote: > >> I want to install a script that will be run as an executable which isn't a > >> big problem on *nix, just put: > >> #! > >> on the first line and make the file executable. > >> > >> However can vary depending on which flavor of *nix or even > >> which flavor of Linux you're using and how ruby was installed. > >> > >> So my question is, does install.rb take care of this? ie. for each script > >> in your package's /bin directory does it prepend the #! > >> prior to installing the script? > >> > >> Also... I would guess that unless you're running cygwin under Windows > >> that install.rb wouldn't be too useful for installing a package on the > >> Windows platform, correct? > >> > > > >What about using > > > >#! /usr/bin/env ruby > > > > Oh, good idea. It seems to work on Linux. Does it work on other *nix's > as well? > Yes. Overall, it depends on /usr/bin/env existing. From what I can tell, it seems ubiquitous(sp?). If your environment is somewhat controlled, it is a great solution. If your environment is not controlled, it is a good solution. One plus is, that you can change your path to point to a different install of Ruby and it will automatically use the right version. However, if the path in hardcoded in the shebang operator, then you are stuck with using the ruby that it points to. (Using env also lets you control environment variables.) -- Jim Freeze ---------- Vote for ME -- I'm well-tapered, half-cocked, ill-conceived and TAX-DEFERRED!