Digest.rb including wrong files on MacOSX


#1

I have been trying to install a Rails app called devalot
(http://software.pmade.com/devalot) on my Mac (10.4 Tiger). I built
Ruby 1.8.5 from source on this box, and have been using it daily for
weeks for Rails development and other, non-Rails R. playing.

In the setup process, it requires a ruby script to run to do some setup:

ruby script/setup.rb

When I run this script, I get this error:

/usr/local/lib/ruby/site_ruby/1.8/digest.rb:16:in `const_missing’:
Digest class not found: Digest::SHA384 (NameError)

Now, when I look in /usr/local/lib/ruby/site_ruby/1.8/digest.rb, I
find these lines:

require ‘digest.so’

module Digest
autoload “SHA256”, “digest/sha2.so”
autoload “SHA384”, “digest/sha2.so”
autoload “SHA512”, “digest/sha2.so”

Now, I don’t have any .so files lying around. I believe the right
things are .bundle files on MacOSX.

I have, in /usr/local/lib/ruby/site_ruby/1.8/i686-darwin8.8.2, a
digest.bundle and a digest/sha2.bundle. I have the same thing in
/usr/local/lib/ruby/1.8/i686-darwin8.8.2. I don’t know why they’re in
both places. They’re not symlinks, and cmp(1) says they’re identical
files. Anyway…

Anyway, can someone tell me what I appear to have done wrong, or what
Ruby did wrong, when I built it to get into this situation?

By way of comparison, the hpricot gem does

require ‘hpricot_scan’

and then there is in its lib dir both ‘hpricot_scan.so’ and
‘hpricot_scan.bundle’.

Any ideas of where to start?


#2

Just a quick update to this, the whole “trying to install this app”
thing was an inadvertent red herring on my part: the problem shows up
in just trying to run Ruby’s ‘make test-all’:

~/src/ruby rew$ make test-all
./miniruby ./runruby.rb --extout=.ext – “./test/runner.rb”
–basedir="./test" --runner=console
/Users/rew/src/ruby/.ext/common/digest.rb:16:in `const_missing’:
Digest class not found: Digest::SHA384 (NameError)
make: *** [test-all] Error 1

If anyone could shed some light on what is going on here, or how to
fix it, I’d be very much obliged.


#3

On 2/20/07, Ryan W. removed_email_address@domain.invalid wrote:

Just a quick update to this, the whole “trying to install this app”
thing was an inadvertent red herring on my part: the problem shows up
in just trying to run Ruby’s ‘make test-all’:

This seems like a bug in Ruby; I would post this to ruby-core or on
rubyforge.org’s Ruby bug tracker.

-austin