Digest::Base problem

Just one thing to check: you don’t happen to have a file called
“digest.rb” lying around in the current directory?

It’s tempting when writing a test program to exercise the digest library
to call it “digest.rb”. But then “require ‘digest’” will fail because it
will load the wrong file :slight_smile:

One way to diagnose this is to find digest.so on your system (e.g.
“locate digest.so”) and then require it with a full path: e.g.

irb(main):001:0> require ‘/usr/lib/ruby/1.8/x86_64-linux/digest.so’
=> true
irb(main):002:0> Digest::Base
=> Digest::Base

OK, this comes down to my code being badly organized. I will get right
at it.

Case closed.

BIG THANKS to all you helpers!

(time to help myself)

Cheers,

Martin

Brian C. wrote in post #998468:

Just one thing to check: you don’t happen to have a file called
“digest.rb” lying around in the current directory?

aaaaaaargh!

AAAAAAAARGH!!!

Yes! That’s it!!! $RUBYLIB includes a dir with another digest.rb.

So - how can avoid this conflict? I prefer not to rename the file if
avoidable.

(BIG THANKS)

Martin