[prev in list] [next in list] [prev in thread] [next in thread] 

List:       ruby-talk
Subject:    Re: running gem
From:       why the lucky stiff <ruby-talk () whytheluckystiff ! net>
Date:       2004-05-10 6:50:04
Message-ID: 409F2617.6030802 () whytheluckystiff ! net
[Download RAW message or body]

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']

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


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic