Digest::Base problem

I have the following problem:

[email protected]:~$ irb
irb(main):001:0> require ‘digest’
=> true
irb(main):002:0> Digest::Base
NameError: uninitialized constant Digest::Base
from (irb):2
from /usr/bin/irb:12:in `’

Apparently, there is something wrong my Ruby compilation.

I have compiled Ruby 1.9.1 and 1.9.2 on Mac, Ubuntu, and Redhat. Same
result. I suspect a missing dependency that don’t raise the alarm.

Suggestions?

Martin

On Thu, May 12, 2011 at 12:59 PM, Martin H. [email protected] wrote:

Apparently, there is something wrong my Ruby compilation.

I have compiled Ruby 1.9.1 and 1.9.2 on Mac, Ubuntu, and Redhat. Same
result. I suspect a missing dependency that don’t raise the alarm.

Do you have OpenSSL devel packages installed? Are they found by
./configure?


Phillip G.

Though the folk I have met,
(Ah, how soon!) they forget
When I’ve moved on to some other place,
There may be one or two,
When I’ve played and passed through,
Who’ll remember my song or my face.

Do you have OpenSSL devel packages installed? Are they found by
./configure?

It doesn’t look like configure do anything ssl - should it?

[email protected]:~/Install/src/ruby-1.9.2-p180$ ./configure | grep -i ssl

This is what’s installed sslwise:

[email protected]:~/Install/src/ruby-1.9.2-p180$ dpkg -l | grep -i ssl
ii libcurl4-openssl-dev 7.18.2-8lenny4
Development files and documentation for libc
ii libssl-dev 0.9.8g-15+lenny11
SSL development libraries, header files and
ii libssl0.9.8 0.9.8g-15+lenny11
SSL shared libraries
ii openssl 0.9.8g-15+lenny11
Secure Socket Layer (SSL) binary and related
ii openssl-blacklist 0.4.2
list of blacklisted OpenSSL RSA keys
ii ssl-cert 1.0.23
simple debconf wrapper for OpenSSL

Martin

On Thu, May 12, 2011 at 1:55 PM, Martin H. [email protected] wrote:

Do you have OpenSSL devel packages installed? Are they found by
./configure?

It doesn’t look like configure do anything ssl - should it?

Yes. OpenSSL provides the crypto-backend that Ruby uses.

./configure --with-openssl=/path/to/shared/library.so

should do the trick, though, since you seem to have everything in
order, otherwise.


Phillip G.

Though the folk I have met,
(Ah, how soon!) they forget
When I’ve moved on to some other place,
There may be one or two,
When I’ve played and passed through,
Who’ll remember my song or my face.

On Thu, May 12, 2011 at 2:45 PM, Martin H. [email protected] wrote:

Yes. OpenSSL provides the crypto-backend that Ruby uses.

./configure --with-openssl=/path/to/shared/library.so

I dont get it. First of all configure complains:

configure: WARNING: unrecognized options: --with-openssl
configure: WARNING: unrecognized options: --with-ssl

./configure --help should, well, help.

Second: I have no idea of what path to point to.

That’s highly specific to your environment, but a “find libssl0.9.8”
should help.

Third: I tried to manually compile ext/openssl and recompile ext/digest,
but still no Digest::Base.

Yeah, those are stubs (i.e. they don’t do anything). There once were
export restrictions in the US on almost all cryptography (technically,
crypto is a weapon as far as US export law is concerned).


Phillip G.

Though the folk I have met,
(Ah, how soon!) they forget
When I’ve moved on to some other place,
There may be one or two,
When I’ve played and passed through,
Who’ll remember my song or my face.

Yes. OpenSSL provides the crypto-backend that Ruby uses.

./configure --with-openssl=/path/to/shared/library.so

I dont get it. First of all configure complains:

configure: WARNING: unrecognized options: --with-openssl
configure: WARNING: unrecognized options: --with-ssl

Second: I have no idea of what path to point to.

Third: I tried to manually compile ext/openssl and recompile ext/digest,
but still no Digest::Base.

Martin

On Thu, May 12, 2011 at 6:59 AM, Martin H. [email protected] wrote:

I have the following problem:

NameError: uninitialized constant Digest::Base

Apparently, there is something wrong my Ruby compilation.

Indeed :slight_smile:

I have compiled Ruby 1.9.1 and 1.9.2 on Mac, Ubuntu, and Redhat. Same
result. I suspect a missing dependency that don’t raise the alarm.

Ubuntu: apt-get install libssl-dev
Red Hat: yum install openssl-devel
Mac: are you using a “ports” system?

./configure --help should, well, help.

I dont really see anything:

http://pastie.org/1892928

Second: I have no idea of what path to point to.

That’s highly specific to your environment, but a “find libssl0.9.8”
should help.

Hm, I see now that /usr/lib contains these:

/usr/lib/libssl.a
/usr/lib/libssl.so
/usr/lib/libssl.so.0.9.8
/usr/lib/libssl3.so
/usr/lib/libssl3.so.1d

But /usr/lib is included per default, right?

Yeah, those are stubs (i.e. they don’t do anything). There once were
export restrictions in the US on almost all cryptography (technically,
crypto is a weapon as far as US export law is concerned).

Crazy!

:o)

Martin

Ubuntu: apt-get install libssl-dev

Already there:

[email protected]:~/Install/src/ruby-1.9.2-p180$ dpkg -l | grep libssl
ii libssl-dev 0.9.8g-15+lenny11
SSL development libraries, header files and
ii libssl0.9.8 0.9.8g-15+lenny11
SSL shared libraries

Mac: are you using a “ports” system?

Yes, openssl @1.0.0d (devel, security) is installed

I am beginning to suspect that ssl is not the problem. openssl and
libssl and libssl-dev is installed on all systems. There is no options
to select alternative paths to libssl in Ruby’s configure script.
Digest::Base does not work with neither my compilations of ruby1.9.1 and
ruby1.9.2 OR with the precompiled Ruby1.9 Debian and Ubuntu packages.

:o( - what then?

Martin

On Thu, May 12, 2011 at 3:02 PM, Martin H. [email protected] wrote:

./configure --help should, well, help.

I dont really see anything:

http://pastie.org/1892928

–with-PACKAGE is the correct one, where “PACKAGE” should be replaced
with “openssl” (so, adding the path was incorrect information on my
part).

But /usr/lib is included per default, right?

It should, yes.

Yeah, those are stubs (i.e. they don’t do anything). There once were
export restrictions in the US on almost all cryptography (technically,
crypto is a weapon as far as US export law is concerned).

Crazy!

Kinda. In the Bad Old Days nobody wanted to hand strong cryptography
to the Soviets. The easiest way was classifying crypto as weapons,
instead of creating a new category (since weapons could be traded with
NATO partners, obviously).


Phillip G.

Though the folk I have met,
(Ah, how soon!) they forget
When I’ve moved on to some other place,
There may be one or two,
When I’ve played and passed through,
Who’ll remember my song or my face.

http://pastie.org/1892928

–with-PACKAGE is the correct one, where “PACKAGE” should be replaced
with “openssl” (so, adding the path was incorrect information on my
part).

We already tried this:

configure: WARNING: unrecognized options: --with-openssl

Same with and without a path, and same for --with-ssl.

Can we somehow test if Ruby has SSL support - without using digest -
which appears to be broken?

Martin

On Thu, May 12, 2011 at 3:36 PM, Martin H. [email protected] wrote:

Can we somehow test if Ruby has SSL support - without using digest -
which appears to be broken?

Sure. Try to access a website that uses HTTPS, like so:

http://olabini.com/blog/2008/08/ruby-https-web-calls/


Phillip G.

Though the folk I have met,
(Ah, how soon!) they forget
When I’ve moved on to some other place,
There may be one or two,
When I’ve played and passed through,
Who’ll remember my song or my face.

On Thu, May 12, 2011 at 9:22 AM, Martin H. [email protected] wrote:

Digest::Base does not work with neither my compilations of ruby1.9.1 and
ruby1.9.2 OR with the precompiled Ruby1.9 Debian and Ubuntu packages.

Debian package: apt-get install libopenssl-ruby1.9

Can we somehow test if Ruby has SSL support - without using digest -
which appears to be broken?

Sure. Try to access a website that uses HTTPS, like so:

irb(main):001:0> require ‘httpclient’
ArgumentError: undefined class/module Digest::Base
from internal:lib/rubygems/custom_require:29:in require' from <internal:lib/rubygems/custom_require>:29:inrequire’
from
/home/maasha/Install/src/Martin/lib/ruby/gems/1.9.1/gems/httpclient-2.2.0.2/lib/httpclient.rb:11:in
<top (required)>' from <internal:lib/rubygems/custom_require>:33:inrequire’
from internal:lib/rubygems/custom_require:33:in rescue in require' from <internal:lib/rubygems/custom_require>:29:inrequire’
from (irb):1
from ./irb:12:in `’

OK, so something ssl is probably fubar. It is strange that it appears to
be a problem with both the precompiled debian packages and my ruby
do-it-yourself compile.

Grrr. I need some systematic approach to track down this issue.

Martin

Debian package: apt-get install libopenssl-ruby1.9

I tested with the precompiled libopenssl-ruby1.9.1 and the precompiled
ruby1.9.1 from Ubuntu. Still no Digest::Base.

What versions of debian/ubuntu/redhat?

Ubuntu 10.04.2 LTS

uname -a
Linux bixeonws 2.6.32-31-server #61-Ubuntu SMP Fri Apr 8 19:44:42 UTC
2011 x86_64 GNU/Linux

Debian 5.0.8

uname -a
Linux maxwell 2.6.31.5 #1 SMP Fri Nov 6 17:07:54 CET 2009 x86_64
GNU/Linux

And my Mac -> snoleopard.

You could also try RVM (after installing the -dev[el] packages).

No idea what this does. I would like to simply compile my own ruby and
have it working.

:o|

Martin

On Thu, May 12, 2011 at 4:39 PM, Martin H. [email protected] wrote:

You could also try RVM (after installing the -dev[el] packages).

No idea what this does. I would like to simply compile my own ruby and
have it working.

https://rvm.beginrescueend.com/

It grabs source code for Ruby implementations, and compiles it.


Phillip G.

Though the folk I have met,
(Ah, how soon!) they forget
When I’ve moved on to some other place,
There may be one or two,
When I’ve played and passed through,
Who’ll remember my song or my face.

On Thu, May 12, 2011 at 10:15 AM, [email protected] wrote:

On Thu, May 12, 2011 at 9:22 AM, Martin H. [email protected] wrote:

Digest::Base does not work with neither my compilations of ruby1.9.1 and
ruby1.9.2 OR with the precompiled Ruby1.9 Debian and Ubuntu packages.

Debian package: apt-get install libopenssl-ruby1.9

(Though I thought this step was no longer necessary?)

What versions of debian/ubuntu/redhat?

You could also try RVM (after installing the -dev[el] packages).

Phillip G. wrote in post #998249:

On Thu, May 12, 2011 at 4:39 PM, Martin H. [email protected] wrote:

You could also try RVM (after installing the -dev[el] packages).

No idea what this does. I would like to simply compile my own ruby and
have it working.

https://rvm.beginrescueend.com/

It grabs source code for Ruby implementations, and compiles it.


Phillip G.

Though the folk I have met,
(Ah, how soon!) they forget
When I’ve moved on to some other place,
There may be one or two,
When I’ve played and passed through,
Who’ll remember my song or my face.

I’ve used this link for installing RVM on Ubuntu, it’s very well-written
and easy to follow.

http://ryanbigg.com/2010/12/ubuntu-ruby-rvm-rails-and-you

https://rvm.beginrescueend.com/

It grabs source code for Ruby implementations, and compiles it.

I think, that I want to get my ruby working the “old fashioned” way
before going fancy.

ruby -rdigest -e “p Digest.const_defined? :Base” => true

I get false on three different systems. Just tested on my office mate’s
mac where it returns ‘true’ (though ruby 1.8.7).

Could it be a problem with old libs sitting around?

Bleh :o(

Martin

On Thu, May 12, 2011 at 10:39 AM, Martin H. [email protected] wrote:

GNU/Linux
x86_64, all of ruby and ssl and ssl-dev are x86_64?

Debian package: apt-get install libopenssl-ruby1.9

I tested with the precompiled libopenssl-ruby1.9.1 and the precompiled
ruby1.9.1 from Ubuntu. Still no Digest::Base.

http://packages.ubuntu.com/lucid/amd64/libopenssl-ruby1.9.1/filelist

On a 32-bit Ubuntu 11.04 (all I have handy right now):

$ ldd /usr/lib/ruby/1.9.1/i686-linux/openssl.so
linux-gate.so.1 => (0x007d1000)
libruby-1.9.1.so.1.9 => /usr/lib/libruby-1.9.1.so.1.9 (0x00a6b000)
libssl.so.0.9.8 => /lib/libssl.so.0.9.8 (0x004f1000)
libcrypto.so.0.9.8 => /lib/libcrypto.so.0.9.8 (0x00e52000)
libpthread.so.0 => /lib/i386-linux-gnu/libpthread.so.0 (0x00619000)
librt.so.1 => /lib/i386-linux-gnu/librt.so.1 (0x00110000)
libdl.so.2 => /lib/i386-linux-gnu/libdl.so.2 (0x00e01000)
libcrypt.so.1 => /lib/i386-linux-gnu/libcrypt.so.1 (0x00367000)
libm.so.6 => /lib/i386-linux-gnu/libm.so.6 (0x00119000)
libc.so.6 => /lib/i386-linux-gnu/libc.so.6 (0x0013f000)
/lib/ld-linux.so.2 (0x0066b000)
libz.so.1 => /lib/i386-linux-gnu/libz.so.1 (0x005de000)

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs