no such file to load -- openssl
Are you using RVM?
If so you may want to reinstall ruby with the location of your openssl installation passed as an option:
$ rvm remove 1.8.7
$ rvm install 1.8.7 --with-openssl-dir=/usr/local/openssl # or wherever openssl is installed
On a Debian-based system, you can find where openssl is installed by running the following command:
$ dpkg -L openssl
Alternatively you can have RVM install openssl for you:
$ rvm package install openssl
$ rvm remove 1.8.7
$ rvm install 1.8.7 --with-openssl-dir=$HOME/.rvm/usr
Note that afterwards you'll need to re-install rails:
$ gem install rails
cannot load such file -- openssl (LoadError)
Check what rubies are installed:
rvm list
Then make sure to use one of the installed rubies:
rvm use 1.9.3-p327
And test if openssl
is available:
ruby -ropenssl -e "puts :OK"
It will print OK
if openssl
is enabled, otherwise you will get exception
In case of exception =>
UPDATE:
new version of rvm has improved automation support:
rvm get stable
rvm autolibs enable
rvm reinstall all --force
OLD:
run:
rvm requirements run force
rvm pkg remove
Followed by:
rvm reinstall all --force
This instruction is not OSX specific, it will work on all platforms, although on OSX it will work best with HomeBrew, when it's not installed only list of required software will be shown and you need to install it manually.
Error while creating new Rails 3 project : `require': cannot load such file -- openssl (LoadError)
You need to bundle your ruby with openssl support. Have a look at http://beginrescueend.com/packages/openssl/
rvm reinstall 1.9.3 --with-openssl-dir=/usr/local
This requires that you have the openssl headers present on your box. These are named differently across the systems, like libopenssl-dev
, libssl-dev
, openssl-devel
etc..
How to resolve Cannot load such file openssl error?
Uninstall ruby and opensssl and then run this:
rvm reinstall 2.2.9 --with-openssl-dir=$HOME/.rvm/usr
ruby 2.0 rails gem install error cannot load such file -- openssl
You have to install OpenSSL first and recompile ruby again:
RVM:
rvm pkg install openssl
rvm reinstall ruby-2.0.0-p0 --with-gcc=gcc-4.7 --with-openssl-dir=$rvm_path/usr
Related Topics
Given an Array of Arguments, How to Send Those Arguments to a Particular Function in Ruby
Ruby on Rails - Drop Down Box on Change Event
How to Uninstall Ruby on Rails on MAC Os X
Looping Through an Array with Step
3 Equals or Case Equality Operator
Update Just One Gem with Bundler
Differencebetween Class and Klass in Ruby
Calling Another Method in Super Class in Ruby
Magic First and Last Indicator in a Loop in Ruby/Rails
How to Uninstall Ruby from /Usr/Local
Using Instance Variables in Class Methods - Ruby
How to Know When to "Refresh" My Model Object in Rails
Emacs Is Ignoring My Path When It Runs a Compile Command
Irb History Not Working with Ruby 2.3.0
In 'Require': No Such File to Load -- Iconv (Loaderror)
Equivalent of "Continue" in Ruby
Create Module Variables in Ruby
Difference Between Truncation, Transaction and Deletion Database Strategies