views:

4617

answers:

6

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?

A: 

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
+3  A: 

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
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
+7  A: 

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

sudo apt-get install libopenssl-ruby

Joel
Perfect. thanks!
Darrel
A: 

tried sudo apt-get install libopenssl-ruby1.8 and sudo apt-get install libopenssl-ruby.. still get the error

last few lines of the trace are

/usr/local/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:2068:in standard_exception_handling' /usr/local/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:1998:inrun' /usr/local/lib/ruby/gems/1.9.1/gems/rake-0.8.7/bin/rake:31:in <top (required)>' /usr/local/bin/rake:19:inload' /usr/local/bin/rake:19:in `'

pdh
A: 

tried sudo apt-get install libopenssl-ruby1.9 and sudo apt-get install libopenssl-ruby.. still get the error. I tried to go to the ruby1.9.2 p0 folder to do "make". But surprisingly I didnt find a /etc folder

$ which ruby /home/user/.rvm/rubies/ruby-1.9.2-p0/bin/ruby

$ which rails /home/user/.rvm/gems/ruby-1.9.2-p0/bin/rails

$ which openssl /usr/bin/openssl

Can someone please help?

confused
A: 

I am also getting the same problem. I installed libopenssl-ruby, libopenssl-ruby1.8 and libopenssl-ruby1.9, still the problem persists.

→ r db:migrate --trace (in /home/pratik/projects/va) rake aborted! no such file to load -- openssl /home/pratik/.rvm/gems/ruby-1.9.2-p0/gems/authlogic-2.1.6/lib/authlogic/crypto_providers/aes256.rb:1:in require' /home/pratik/.rvm/gems/ruby-1.9.2-p0/gems/authlogic-2.1.6/lib/authlogic/crypto_providers/aes256.rb:1:in' /home/pratik/.rvm/gems/ruby-1.9.2-p0/gems/authlogic-2.1.6/lib/authlogic.rb:59:in require' /home/pratik/.rvm/gems/ruby-1.9.2-p0/gems/authlogic-2.1.6/lib/authlogic.rb:59:inblock in ' /home/pratik/.rvm/gems/ruby-1.9.2-p0/gems/authlogic-2.1.6/lib/authlogic.rb:6:in each' /home/pratik/.rvm/gems/ruby-1.9.2-p0/gems/authlogic-2.1.6/lib/authlogic.rb:6:in' /home/pratik/.rvm/gems/ruby-1.9.2-p0@global/gems/bundler-1.0.3/lib/bundler/runtime.rb:64:in require' /home/pratik/.rvm/gems/ruby-1.9.2-p0@global/gems/bundler-1.0.3/lib/bundler/runtime.rb:64:inblock (2 levels) in require' /home/pratik/.rvm/gems/ruby-1.9.2-p0@global/gems/bundler-1.0.3/lib/bundler/runtime.rb:62:in each' /home/pratik/.rvm/gems/ruby-1.9.2-p0@global/gems/bundler-1.0.3/lib/bundler/runtime.rb:62:inblock in require' /home/pratik/.rvm/gems/ruby-1.9.2-p0@global/gems/bundler-1.0.3/lib/bundler/runtime.rb:51:in each' /home/pratik/.rvm/gems/ruby-1.9.2-p0@global/gems/bundler-1.0.3/lib/bundler/runtime.rb:51:inrequire' /home/pratik/.rvm/gems/ruby-1.9.2-p0@global/gems/bundler-1.0.3/lib/bundler.rb:112:in require' /home/pratik/projects/va/config/application.rb:7:in' :29:in require' <internal:lib/rubygems/custom_require>:29:inrequire' /home/pratik/projects/va/Rakefile:4:in <top (required)>' /home/pratik/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.8.7/lib/rake.rb:2383:inload' /home/pratik/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.8.7/lib/rake.rb:2383:in raw_load_rakefile' /home/pratik/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.8.7/lib/rake.rb:2017:inblock in load_rakefile' /home/pratik/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.8.7/lib/rake.rb:2068:in standard_exception_handling' /home/pratik/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.8.7/lib/rake.rb:2016:inload_rakefile' /home/pratik/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.8.7/lib/rake.rb:2000:in block in run' /home/pratik/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.8.7/lib/rake.rb:2068:instandard_exception_handling' /home/pratik/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.8.7/lib/rake.rb:1998:in run' /home/pratik/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.8.7/bin/rake:31:in' /home/pratik/.rvm/gems/ruby-1.9.2-p0/bin/rake:19:in load' /home/pratik/.rvm/gems/ruby-1.9.2-p0/bin/rake:19:in'

Pratik Khadloya