简体   繁体   中英

cannot load such file -- openssl (LoadError)

In OS X in rvm how do I check if openssl is configured properly? I get the cannot load such file -- openssl (LoadError) And I have tried everything in Rails 3 - no such file to load -- openssl with no success.

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.

Many years later, the solution is changed because of brew upgrading, this works now:

# pull full brew git repo
git -C "/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core" fetch --unshallow

# generate new brew tap repo
brew tap-new $USER/old-openssl

# extract openssl 1.0.2t forumlar to $USER/old-openssl
brew extract --version=1.0.2t openssl $USER/old-openssl

# install old openssl from $USER/old-openssl repo
brew install openssl@1.0.2t

# reinstall ruby
rvm reinstall 2.3.4 --with-openssl-dir=`brew --prefix openssl@1.0.2t`

尝试这个。

rvm install ruby-2.0.0-preview1  --with-openssl-dir=$HOME/.rvm/usr --verify-downloads 1

I uninstalled everything (rvm, rails, ruby, etc) on my macbook.

Installed homebrew

Installed rvm

Ran rvm requirements run force

Ran rvm install rails

rails new sample_app

cd sample_app

Note: source 'https://rubygems.org' is present in Gemfile, openssl is required!

bundle install and it worked !

No need to specify: --with-openssl-dir=$HOME/.rvm/usr

To resolve this, install openssl (preferably using brew) .

Update Xcode to the latest version and enable command line installations using it.

Reinstall rvm using rvm reinstall all

Note that rvm reinstall all --force will delete all your previous installations of binaries/pkgs done using rvm.

Assuming ruby is already installed, do the following:

rvm cleanup all

rvm reinstall all --force

I got the same error, and the error was fixed by opening new terminal session.

I am using frum ruby version manager.

This help me : https://gist.github.com/Irio/1496746

$ rvm pkg install openssl

$ rvm remove 1.9.3

$ rvm install 1.9.3 --with-openssl-dir=$rvm_path/usr

gem install openssl
为我工作,但没有任何声明取决于openssl,它很奇怪

Following command solved my issue note 2.3.4 is the ruby version I am using, change as per your requirements

rvm reinstall 2.3.4 --with-openssl-dir=$rvm_path/usr

Make sure that $rvm_path is properly set, with command echo $rvm_path . If this path is empty, check if your home folder has .rvm folder.

In this case use

rvm reinstall 2.3.4 --with-openssl-dir=~/.rvm/usr

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM