12

I am trying to do 'rake db:migrate' and getting the error message 'no such file to load -- openssl'. Both 'openssl' and 'openssl-devel' packages are installed. Others on Debian or Ubuntu seem to be able to get rid of this by installing 'libopenssl-ruby', which is not available for RedHat. Has anybody run into this and have a solution for it?

James A. Rosen
  • 64,193
  • 61
  • 179
  • 261

5 Answers5

13

I had this problem on Ubuntu, after upgrading to 8.10. The solution for Ubuntu was

sudo apt-get install libopenssl-ruby

Joel
  • 11,431
  • 17
  • 62
  • 72
10

it seems you need to make the ruby header file

go into the openssl directory and:

ruby extconf.rb
cd ../..
make
make install

See here

gbjbaanb
  • 51,617
  • 12
  • 104
  • 148
  • 1
    This answer assumes that you've compiled your own ruby binary. The extconf.rb file is located in the ruby-X.X.X/ext/openssl/ directory. – Steropes Oct 01 '08 at 21:26
  • Worked for me too, needed to install ruby1.8-dev to solve a mkmf? error though (extconf.rb:17:in `require': no such file to load -- mkmf (LoadError)) `sudo apt-get install ruby1.8-dev` – jobwat Jun 03 '11 at 23:21
  • You may need to specify the location of your openssl libraries (as suggested in the linked article). I had to use `ruby extconf.rb --with-openssl-include=/usr/local/ssl/include --with-openssl-lib=/usr/local/ssl/lib` – David Waller Jul 25 '11 at 15:52
8

If you are using RVM to manage your rubies follow the directions here:

http://rvm.io/packages/openssl/

mpapis
  • 52,729
  • 14
  • 121
  • 158
whistler
  • 767
  • 7
  • 11
0

I had the same issue. I tried going into the openssl folder and running make etc but it couldnt find the libraries lcrypto. I solved the issue by running ruby 1.9.3-p327.

Hope this helps!

VarunMurali
  • 413
  • 1
  • 6
  • 17
0

There is probably a gem you are missing. Can you provide the stack trace and the line of code where it originates?

Re-run rake with --trace to get the stack trace printed.

EDIT: Also what version of Ruby are you running? openssl.rb is in my 1.8.6 install

Otto
  • 18,761
  • 15
  • 56
  • 62