简体   繁体   中英

Ruby LoadError on OEL

I've just installed ruby on an OEL 5.8 server and am seeing some strange behaviour

Server details

 Linux myhost 2.6.18-238.el5 #1 SMP Tue Jan 4 15:41:11 EST 2011 x86_64 x86

Ruby version

ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-linux]

when I try and run a ruby program I get an odd error

 -sh-3.2$ ruby testing.rb
 ruby: No such file or directory -- ('» (LoadError)

similarly calling gem returns a similar error

-sh-3.2$ gem -v
/usr/bin/ruby: No such file or directory -- (W
(LoadError)

Running a strace on ruby shows this error before it dies

lstat("/usr", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
lstat("/usr/lib", {st_mode=S_IFDIR|0755, st_size=12288, ...}) = 0
lstat("/usr/lib/ruby", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
lstat("/usr/lib/ruby/site_ruby", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
lstat("/usr/lib/ruby/site_ruby/1.9.1", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
lstat("/usr/lib/ruby/site_ruby/1.9.1/rubygems", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
lstat("/usr/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb",  {st_mode=S_IFREG|0644, st_size=1871, ...}) = 0
open("(\227I\6", O_RDONLY)              = -1 ENOENT (No such file or directory)
rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
write(2, "ruby", 4ruby)                     = 4
write(2, ": ", 2: )                       = 2
write(2, "No such file or directory -- (\227I"..., 33No such file or directory -- (I) = 33
write(2, " (", 2 ()                       = 2
write(2, "LoadError", 9LoadError)                = 9
write(2, ")\n", 2)
)                      = 2
getrlimit(RLIMIT_STACK, {rlim_cur=10240*1024, rlim_max=RLIM_INFINITY}) = 0
rt_sigaction(SIGINT, {0x1, [], SA_RESTORER|SA_SIGINFO, 0x319d00eb10}, {0x4b1eb0, [],   SA_RESTORER|SA_SIGINFO, 0x319d00eb10}, 8) = 0
rt_sigaction(SIGINT, {SIG_DFL, [], SA_RESTORER|SA_SIGINFO, 0x319d00eb10}, {0x1, [], SA_RESTORER|SA_SIGINFO, 0x319d00eb10}, 8) = 0
write(4, "!", 1)                        = 1
munmap(0x2ac6c5784000, 1052672)         = 0
exit_group(1)  

I have the full output if anyone wants to see it

strangly each time I call ruby I get a slightly different error message (eg)

-sh-3.2$ ruby testing.rb
ruby: No such file or directory -- (Ç/ (LoadError)
-sh-3.2$ ruby testing.rb
ruby: No such file or directory -- Ç (LoadError)
-sh-3.2$ ruby testing.rb
ruby: No such file or directory -- 0w;   (LoadError)
-sh-3.2$ ruby testing.rb
ruby: No such file or directory -- NULLCMD (LoadError)
-sh-3.2$ ruby testing.rb
ruby: No such file or directory -- 07î (LoadError)

and in each case my strace shows errors like this before it dies

lstat("/usr/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb", {st_mode=S_IFREG|0644, st_size=1871, ...}) = 0
open("\20\7\3\30", O_RDONLY)            = -1 ENOENT (No such file or directory)

I noticed this happening weeks ago and did a reinstall of ruby which fixed it, but at 4am yesterday the problem happened again which is very strange as the box was no being used during that period

I have done the usual stuff like checking for other versions of Ruby and all looks fine so I'm a bit stuck on this one

Does anyone have any idea what could be causing it? And more importantly how to fix it

Cheers

Mike

Ran into this problem on a system running RHEL 6.3. The prelink package runs once a day and corrupts the ruby binary. I uninstalled prelink and replaced the ruby binary.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM