Digest::Base problem

B

Brian Candler

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 :)

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
 
M

Martin Hansen

Brian Candler 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
 
M

Martin Hansen

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,109
Messages
2,570,671
Members
47,262
Latest member
EffiePju4

Latest Threads

Top