From: Jim Menard Date: 2004-05-10T21:14:35+09:00 Subject: Re: running gem On May 10, 2004, at 2:50 AM, why the lucky stiff wrote: > Chad Fowler wrote: >> We us a program called "env" with the argument "ruby" to >> find ruby in the path and run the script with whatever ruby was found >> in the path. > > In the classic install.rb, the path to ruby is used rather than 'env'. > This is great for situations where ruby isn't anywhere that can be > found by 'whereis' or 'env'. The path is built like so: > > require 'rbconfig' > c = ::Config::CONFIG > rubypath = c['bindir'] + '/' + c['ruby_install_name'] Shouldn't that be rubypath = File.join(c['bindir'], c['ruby_install_name']) so it works on some future OS that does not use '/' as its path separator and has a shebang line in scripts and is not Windows? > I like this approach a lot. This way, if I want to install RubyGems > for my Ruby 1.6 installation, then `ruby16 install.rb' will do the > trick fine. > > _why > > Jim -- Jim Menard, jimm@io.com, http://www.io.com/~jimm/ "It's overkill, of course. But you can never have too much overkill." -- Anonymous Coward on slashdot.org