Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

uninitialized constant OpenSSL (NameError)

I've been developing an application with decryption of data files using OpenSSL but this isn't working when deployed to our stage server. Is there some configuration step required to include OpenSSL that I've missed on the server? I didn't do anything special to make it work locally (developing on windows).

The line that causes the error is:

rescue_from OpenSSL::Cipher::CipherError, :with => :cipher_error

in one of my controllers.

Ruby 1.8.7, Rails 3.0.4 No gems were used to add OpenSSL support, it just worked locally.

The actual decryption of files is working fine (code is in a module in /lib), it's just this line in the controller that fails.

like image 306
Matt Avatar asked Jun 07 '13 09:06

Matt


1 Answers

You can try to explicitly require openssl

require 'openssl'

Have you installed ruby 1.8.7 with rvm ?

If so, you might want to take a look at this link: http://jronallo.github.io/blog/ruby-and-rails-using-rvm-on-a-fresh-and-updated-ubuntu-11-dot-10-install

Maybe related SO question: Rails 3 - no such file to load -- openssl

like image 109
Arkan Avatar answered Oct 04 '22 01:10

Arkan