Uninitialized constant OpenSSL::Digest::SHA1

Trying to create a simple “hello world” application. So far I simply
deleted the /public/index.html file and created a home controller. When
I try to browse to the page, I get an uninitialized constant
OpenSSL::Digest::SHA1 error. Couple of pieces of information. OS is
Windows 7 and I am using the Visual Studio as my IDE. I’ve done some
googleing, but I haven’t been able to find any articles that describe
the error I’m having. I’ve installed OpenSSL using a windows installer
and I tried copying ssleay32.dll and libeay32.dll into the IronRuby bin
folder, but that did not work. Seems like I must be missing something
really basic.

Thanks,
Craig

Hi there,

It seems like you are using some kind of framework/web server - what
would
that be?
Do you use Sinatra or how does is your Ruby web application structured?

Best regards,
Per

OpenSSL in Ruby is implemented in a C Extension. Last I checked,
IronRuby can’t load C extensions.

I looked into doing a .NET port of OpenSSL for IronRuby, but quickly got
lost in the .NET Crypto APIs. This was 2 years ago.


Will G.
[email protected]

Thanks for all the responses. The thing that baffling me is that
IronRuby has an install that includes Visual Studio integration. So, it
would seem that I should be able to get Hello World to work… I must
have some specific “oddity” to my system that is hosing the
IronRuby/Rails install.

Craig

----- Original Message -----

From: “Will G.” [email protected]
To: [email protected]
Sent: Tuesday, May 1, 2012 10:32:54 PM
Subject: Re: [Ironruby-core] uninitialized constant
OpenSSL::Digest::SHA1

OpenSSL in Ruby is implemented in a C Extension. Last I checked,
IronRuby can’t load C extensions.

I looked into doing a .NET port of OpenSSL for IronRuby, but quickly got
lost in the .NET Crypto APIs. This was 2 years ago.


Will G.
[email protected]


Ironruby-core mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/ironruby-core

Well, I got it to work… But I’m not sure why. In the ActiveSupport
3.0.1 gem, I made a change to line 59 in the message_verifier.rb.

I changed it from:
OpenSSL::HMAC.hexdigest(OpenSSL::Digest.const_get(@digest).new, @secret,
data)
To:
OpenSSL::HMAC.hexdigest(OpenSSL::Digest::Digest.new(@digest), @secret,
data)

I have no idea why it worked. Only figured it out by hacking around in
iirb.

----- Original Message -----

From: “Will G.” [email protected]
To: [email protected]
Sent: Tuesday, May 1, 2012 10:32:54 PM
Subject: Re: [Ironruby-core] uninitialized constant
OpenSSL::Digest::SHA1

OpenSSL in Ruby is implemented in a C Extension. Last I checked,
IronRuby can’t load C extensions.

I looked into doing a .NET port of OpenSSL for IronRuby, but quickly got
lost in the .NET Crypto APIs. This was 2 years ago.


Will G.
[email protected]


Ironruby-core mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/ironruby-core