Digest::Base problem

M

Martin Hansen

I have the following problem:

maasha@mel:~$ 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 `<main>'


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
 
P

Phillip Gawlowski

I have the following problem:

maasha@mel:~$ irb
irb(main):001:0> require 'digest'
=3D> true
irb(main):002:0> Digest::Base
NameError: uninitialized constant Digest::Base
=A0 =A0 =A0 =A0from (irb):2
=A0 =A0 =A0 =A0from /usr/bin/irb:12:in `<main>'


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=
?

--=20
Phillip Gawlowski

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.
 
M

Martin Hansen

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

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

maasha@maxwell:~/Install/src/ruby-1.9.2-p180$ ./configure | grep -i ssl

This is what's installed sslwise:

maasha@maxwell:~/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
 
P

Phillip Gawlowski

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 Gawlowski

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.
 
M

Martin Hansen

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
 
P

Phillip Gawlowski

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 Gawlowski

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.
 
M

Martin Hansen

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

I dont really see anything:

http://pastie.org/1892928


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!


:eek:)


Martin
 
B

brabuhr

I have the following problem:

NameError: uninitialized constant Digest::Base

Apparently, there is something wrong my Ruby compilation.

Indeed :)
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?
 
M

Martin Hansen

Ubuntu: apt-get install libssl-dev

Already there:

maasha@maxwell:~/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.

:eek:( - what then?


Martin
 
P

Phillip Gawlowski

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.

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 Gawlowski

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.
 
M

Martin Hansen

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
 
P

Phillip Gawlowski

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 Gawlowski

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.
 
M

Martin Hansen

Can we somehow test if Ruby has SSL support - without using digest -
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:in `require'
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:in `require'
from <internal:lib/rubygems/custom_require>:33:in `rescue in
require'
from <internal:lib/rubygems/custom_require>:29:in `require'
from (irb):1
from ./irb:12:in `<main>'


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
 
B

brabuhr

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
 
B

brabuhr

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).
 
M

Martin Hansen

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.



:eek:|


Martin
 
P

Phillip Gawlowski

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 Gawlowski

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.
 
L

Linda Metcalfe

Phillip Gawlowski wrote in post #998249:
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 Gawlowski

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
 
M

Martin Hansen

https://rvm.beginrescueend.com/
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 :eek:(



Martin
 
B

brabuhr

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

x86_64, all of ruby and ssl and ssl-dev are x86_64?
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)
 

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
473,755
Messages
2,569,537
Members
45,020
Latest member
GenesisGai

Latest Threads

Top