Improving Wetware

Because technology is never the issue

Strange error from RubyGems due to linux prelink …

Posted by Pete McBreen Thu, 07 Apr 2011 21:32:00 GMT

After installing Ruby 1.9.2 from source on Centos, a few days later got a strange error from rake and gem commands

# gem list
<internal:lib/rubygems/custom_require>:29:in `require': No such file or directory - ?? (Errno::ENOENT)
       from <internal:lib/rubygems/custom_require>:29:in `require'
       from /usr/bin/gem:8:in `<main>'

Found a fix for this at Ruby Forum Beware prelink and compiling ruby from source. The problem seems to be prelink corrupts ruby, so just need to ban prelink from touching the ruby executables and libraries. Need to ban /usr/bin/ruby in /etc/prelink.conf. by adding the line

-b /usr/bin/ruby

to the conf file. Hopefully someone else will find this in the search engines and not have to reinstall ruby too many times (but once it has occurred you will need to reinstall to fix the corruption).