'env ruby -v' returns nothing

S

Sean Hussey

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
details:

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 =3D
Gem::Version::Requirement.new(">=3D 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
/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.

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!

Sean
 
J

Jacob Fugal

# /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
 
S

Sean Hussey

Whoa. Check this out. On one of the "good" machines (some info snipped):

# /usr/bin/env
HOSTNAME=3Dblah
TERM=3Dxterm-color
SHELL=3D/bin/bash
HISTSIZE=3D100
SSH_CLIENT=3D::ffff:10.4.74.75 49771 22
SSH_TTY=3D/dev/pts/0
USER=3Droot
LS_COLORS=3Dno=3D00:fi=3D00:di=3D01;34:ln=3D01;36:pi=3D40;33:so=3D01;35:bd=
=3D40;33;01:cd=3D40;33;01:eek:r=3D01;05;37;41:mi=3D01;05;37;41:ex=3D01;32:*.cm=
d=3D01;32:*.exe=3D01;32:*.com=3D01;32:*.btm=3D01;32:*.bat=3D01;32:*.sh=3D01=
;32:*.csh=3D01;32:*.tar=3D01;31:*.tgz=3D01;31:*.arj=3D01;31:*.taz=3D01;31:*=
lzh=3D01;31:*.zip=3D01;31:*.z=3D01;31:*.Z=3D01;31:*.gz=3D01;31:*.bz2=3D01;=
31:*.bz=3D01;31:*.tz=3D01;31:*.rpm=3D01;31:*.cpio=3D01;31:*.jpg=3D01;35:*.g=
if=3D01;35:*.bmp=3D01;35:*.xbm=3D01;35:*.xpm=3D01;35:*.png=3D01;35:*.tif=3D=
01;35:
MAIL=3D/var/spool/mail/root
PATH=3D/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:=
/sbin:/bin:/usr/sbin:/usr/bin:/usr/X11R6/bin:/usr/local/libexec:/root/bin
INPUTRC=3D/etc/inputrc
PWD=3D/root
LANG=3Den_US.UTF-8
SHLVL=3D1
HOME=3D/root
LESSOPEN=3D|/usr/bin/lesspipe.sh %s
G_BROKEN_FILENAMES=3D1
_=3D/usr/bin/env
#

Now, on the "bad" machine:

# /usr/bin/env
#

Huh?!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,997
Messages
2,570,240
Members
46,830
Latest member
HeleneMull

Latest Threads

Top