Running gem

I’m testing a new host. All is not so great. It is bsd. I’m kind of new
to unix.

* [Download]
  <http://rubyforge.org/project/showfiles.php?group_id=126> RubyGems
* check
* Unpack the distribution (zip or tar.gz)
* check
* cd rubygems-version.number
* yep
* /made myself super use/r
* ruby install.rb (NOTE: You'll need to have write access to your
  Ruby site_library directory).

The install of gems seemed to go ok.(i dont remember the message
exactly but it was positive)

But when running
#>gem -Rl

#>env: ruby: No such file or directory

I’ve restarted my terminal in case there was a path problem.

I’ve got these aliases in .cshrc

alias ruby /usr/local/bin/ruby18
alias irb /usr/local/bin/irb18

If that makes a difference.

Anyway, thanks.

I’m testing a new host. All is not so great. It is bsd. I’m kind of new
to unix.

* [Download]
  <http://rubyforge.org/project/showfiles.php?group_id=126> RubyGems
* check
* Unpack the distribution (zip or tar.gz)
* check
* cd rubygems-version.number
* yep
* /made myself super use/r
* ruby install.rb (NOTE: You'll need to have write access to your
  Ruby site_library directory).

The install of gems seemed to go ok.(i dont remember the message
exactly but it was positive)

But when running
#>gem -Rl

#>env: ruby: No such file or directory

Hi Paul. 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. By the look of the error message, the env program can’t
find ruby on your system for some reason. I ran it on my Mac with a
bogus program name and you can see that the output is similar:

tashi-delek:~ chadfowler$ /usr/bin/env hello_paul
env: hello_paul: No such file or directory

Now if I run env manually with “ruby” as the parameter, I see:

tashi-delek:~ chadfowler$ env ruby -e ‘puts “hello”’
hello

It appears that the “env” program doesn’t deal with shell aliases (not
surprising):

tashi-delek:~ chadfowler$ alias myruby=/usr/local/bin/ruby
tashi-delek:~ chadfowler$ myruby -v
ruby 1.9.0 (2004-04-30) [powerpc-darwin]
tashi-delek:~ chadfowler$ /usr/bin/env myruby
env: myruby: No such file or directory

Can you try changing the first line of your “gem” script to look like:
#!/usr/local/bin/ruby18

Alternatively, you could create a symbolic link to your ruby
interpreter and call it “ruby” instead of using the aliases:
ln -s /usr/local/bin/ruby18 /usr/local/bin/ruby

Chad

···

On Mon, 10 May 2004 08:18:53 +0900, Paul Vudmaska paul@vudmaska.com wrote:

I’ve restarted my terminal in case there was a path problem.

I’ve got these aliases in .cshrc

alias ruby /usr/local/bin/ruby18
alias irb /usr/local/bin/irb18

If that makes a difference.

Anyway, thanks.

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

That’s a good reason. I’ll add that to the TODO list.

Chad

···

On Mon, 10 May 2004 15:50:04 +0900, why the lucky stiff ruby-talk@whytheluckystiff.net 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’]

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.

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

···

On May 10, 2004, at 2:50 AM, why the lucky stiff wrote:

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