Thursday, January 20, 2011

OpenSSL support for Ruby: "Cipher is not a module (TypeError)"

The Problem

Our systems admin needed to upgrade the packages on our CentOS 5.4 dev server to match the packages on our production server. The upgrade affected ruby and/or openssl.

We run a Ruby on Rails issue tracking system called Redmine that is deployed with Passenger on Apache. Everything worked before the server update, but when trying to access the ticket system now, I get the following error:

Error message:

Cipher is not a module

Exception class:

TypeError

Application root:

/home/dev/rails/redmine-0.8.7 

I've been trying so hard to fix this problem but I can't seem to beat it.

I have tried following this guide:
http://iamclovin.posterous.com/how-to-solve-the-cipher-is-not-a-module-error

When I try require 'openssl' in IRB, I do see a true return value. However, I'm still seeing the Cipher.rb is not a module TypeError when accessing the ticket system.

Possibly (probably) related:

I've tried updating Passenger, but when I try passenger-install-apache2-module I see:

Checking for required software...

* GNU C++ compiler... found at /usr/bin/g++
* Ruby development headers... found
* OpenSSL support for Ruby... /usr/lib/ruby/1.8/openssl/cipher.rb:22: Cipher is not a module (TypeError)

Any help?

  • ruby 1.8.7 (2009-12-24 patchlevel 248) [x86_64-linux]

    in ruby source directory

    cd ext/openssl/
    ruby extconf.rb 
    make
    sudo make install
    sudo cp -R /usr/local/lib/ruby/site_ruby/1.8/openssl* /usr/lib/ruby/1.8/
    

    Finding a fix for this took a very long time...

    From macek
  • Thanks a lot! Just having the same, had to compile my ruby myself, what fedora has is 1.8.6

    From Slavik

0 comments:

Post a Comment