At Fri, 23 Feb 2007 12:44:01 +0900,
Ryan Waldron wrote:
> While trying to install a Rails app on my Mac (10.4 Tiger), I ran into
> a vexing issue with digest.rb.  I installed Ruby from source on this
> box (1.8.5), and have been using it daily for
> weeks for Rails development and other, non-Rails Ruby playing.
> 
> Anyway, Ruby builds and installs fine, and (like I said) I have had no
> other problems with my Ruby install.  But while running part of this
> app's setup, I got this error:
> 
> /usr/local/lib/ruby/site_ruby/1.8/digest.rb:16:in `const_missing':
> Digest class not found: Digest::SHA384 (NameError)
> 
> But it's not the app itself; it turns out that I can duplicate the
> problem by running Ruby's own 'make test-all' in the build directory:
> 
> ~/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
> 
> 
> 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"
> ...

The piece of code does not exist in the 1.8.5 release, so I presume
you are using a snapshot of the ruby_1_8 branch.  Try either
1.8.6-preview1 or the latest ruby_1_8 snapshot which has a workaround
applied.

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

That's not an issue, actually.  You can use the .so suffix universally
regardless of running platforms.  The Ruby interpreter knows what
suffix the running platform uses and replaces the .so part with the
correct suffix when loading a module.

The problem is suspected to be either in the autoload mechanism or OS
X's dynamic loading support, but still under investigation.

Regards,

-- 
                     /
                    /__  __            Akinori.org / MUSHA.org
                   / )  )  ) )  /     FreeBSD.org / Ruby-lang.org
Akinori MUSHA aka / (_ /  ( (__(  @ iDaemons.org / and.or.jp

"Different eyes see different things,
    Different hearts beat on different strings --
       But there are times for you and me when all such things agree"