From: Eric Hodel Date: 2004-11-06T16:35:38+09:00 Subject: Re: Ruby 1.4.6 - trouble with require path --sdEQJo40s7ofW8iR Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Ken Innes (primehalo@hotmail.com) wrote: > Well, "setenv RUBYLIB /scripts" was the right solution. I don't quite > understand what was going on; RUBYLIB was set (as verified by typing > "setenv"), but Ruby couldn't find the scripts until I restarted the > computer. Then it seemed to work fine. >=20 > But now I'm having another weird problem where accessing the PATH > environment variable is causing Ruby not find scripts. For example: > /scripts/script1.rb: > #!/usr/bin/ruby > print `script3.rb` >=20 > /scripts/script2.rb: > #!/usr/bin/ruby > ENV["PATH"].split(/:/).each { |i| > #do nothing > } > print `script3.rb` >=20 > /scripts/script3.rb: > #!/usr/bin/ruby > print "Testing...\n" >=20 > Command Prompt: > [scripts]# cd /testing > [testing]# script1.rb > Testing.... > [testing]# script2.rb > /testing/script2:4: command not found: script3 >=20 > Any access to ENV["PATH"] seems to cause the problem, for example: > print ENV["PATH"] > tmp =3D ENV["PATH"] > ENV["PATH"].chomp! >=20 > Any ideas on this one? Looking at the code for ENV.[], I don't see anything that would cause this, unless there's some bug in your libc with getenv. Perhaps you should try a bash-like shell instead of a csh-like shell? Oh, try this: puts ENV["PATH"] puts `env | grep path` See if your PATH is really destroyed. --=20 Eric Hodel - drbrain@segment7.net - http://segment7.net All messages signed with fingerprint: FEC2 57F1 D465 EB15 5D6E 7C11 332A 551C 796C 9F04 --sdEQJo40s7ofW8iR Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.2 (FreeBSD) iD8DBQFBjH7HMypVHHlsnwQRApbxAJ0ehAFKGy4NMzKDpzn4B7viqcnWkgCfZFbx qFMpvpY2MOHtszO789ofLU0= =MCAX -----END PGP SIGNATURE----- --sdEQJo40s7ofW8iR--