tags:

views:

105

answers:

1

We have two servers with the same home-brewed RPM of ruby installed. One one server, the search path is different, and it fails the following snippet.

#!/usr/bin/env ruby
require 'openssl'
require 'digest/md5'
puts OpenSSL::Digest::MD5.new

Broken server output:

/tmp/test.rb 
/tmp/test.rb:6: uninitialized constant OpenSSL::Digest::MD5 (NameError)

Good server output:

/tmp/test.rb
d41d8cd98f00b204e9800998ecf8427e

Broken server with command line flags can be made to work:

ruby -I /usr/lib/ruby/1.8 /tmp/test.rb 
d41d8cd98f00b204e9800998ecf8427e

Both are CentOS 4.4 x86_64, ruby 1.8.6 p369. We built our own RPM based on Fedora 11 RPM spec file. It works find on 913 other boxes. Help?

A: 

There's really not much we can do if you don't tell us more about your installation. You apparently have a broken library search path, but you already knew that. What is the value of the $: variable on each of the machines?

Edit: Oh, a wild guess: since you're using env, the ruby executable invoked is the first one in your PATH. Are you sure there isn't some other ruby installed in /usr/local, for instance, on this particular machine?

Arthur Reutenauer