Forum: Ruby 'env ruby -v' returns nothing

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
2b2c2a705ed12f8fb327c7b4c56456c6?d=identicon&s=25 Sean Hussey (seanhussey)
on 2006-01-16 16:18
(Received via mailing list)
Hi everyone,

I''m trying to figure out why rubygems won't install correctly on this
particular RHEL4 box, but it does on others.  Obviously, it's an
environment issue, but I can't track down where.  here are some

Compiling ruby 1.8.4 on 6 RHEL4 machines.  5 were ok.  The one I do
the most dev on is not.  Ruby works fine, but rubygems does not:

# gem -v
/usr/local/bin/gem: line 3: require: command not found
/usr/local/bin/gem: line 4: Gem.manage_gems: command not found
/usr/local/bin/gem: line 6: syntax error near unexpected token `('
/usr/local/bin/gem: line 6: `required_version =">= 1.8.0")'

gem installs with '/usr/bin/env ruby' as the default startup line, but
running this myself returns zilch:

# /usr/bin/env ruby
# /usr/bin/env ruby -v
# which gem
# which ruby

Changing the shebang line in /usr/local/bin/gem to use
/usr/local/bin/ruby works as far as gem -v goes, but I'm afraid to use
it if I don't know what env vars it might use otherwise.

I have no ruby-based rpms installed anymore (I did once, but they
haven't been updated since 1.8.1, so I scrapped them).  I've rm -rf'ed
the entire ruby distribution and started from scratch, so I'm thinking
it must be environment.  Does anybody have a suggestion as to what
could cause this?  I see no obvious discrepancies between this machine
and any of the other 5.  Where should I look next?

Thank you!

Cff9eed5d8099e4c2d34eae663aae87e?d=identicon&s=25 Jacob Fugal (Guest)
on 2006-01-16 17:28
(Received via mailing list)
On 1/16/06, Sean Hussey <> wrote:
> # /usr/bin/env ruby
> # /usr/bin/env ruby -v
> # which gem
> /usr/local/bin/gem
> # which ruby
> /usr/local/bin/ruby
> Changing the shebang line in /usr/local/bin/gem to use
> /usr/local/bin/ruby works as far as gem -v goes, but I'm afraid to use
> it if I don't know what env vars it might use otherwise.

It certainly does sound like an environment issue. My guess is the
PATH doesn't include /usr/local/bin, but if you can run 'gem' that
couldn't be it. Try running '/usr/bin/env' (without the 'ruby -v') on
each machine. This prints out the current environment and you can
compare to find the environment differences.

Jacob Fugal
2b2c2a705ed12f8fb327c7b4c56456c6?d=identicon&s=25 Sean Hussey (seanhussey)
on 2006-01-17 01:09
(Received via mailing list)
Whoa.  Check this out.  On one of the "good" machines (some info

# /usr/bin/env
SSH_CLIENT=::ffff: 49771 22
LESSOPEN=|/usr/bin/ %s

Now, on the "bad" machine:

# /usr/bin/env

This topic is locked and can not be replied to.