Ruby and "You must recompile Ruby with OpenSSL support or change the sources in your Gemfile"

This works for me:

rvm get stable

brew install libyaml

rvm pkg install openssl

rvm install ruby-2.0.0 --with-openssl-dir=$HOME/.rvm/usr

rvm use ruby-2.0.0

All credits go to https://coderwall.com/p/tptocq


This helps me install 1.9.3-head on Mac:

rvm get latest    
brew install openssl    
rvm reinstall 1.9.3-head --with-openssl-dir=`brew --prefix openssl`

In my case after:

 1. brew install openssl
 2. rvm install ruby-2.6.0

bundle install failed with this error. The problem was that openssl was globally set so I had to install the new ruby version by setting the openssl directory explicitly.

So what I had to do was:

 1. rvm reinstall ruby-2.6.0 --with-openssl-dir=/usr/local/opt/openssl
 2. rvm reload

Assuming that usr/local/opt/openssl is where it is installed.

After that bundle install ran successfully.

Warning when I tried this command with this path /usr/local like some answers suggested, it didn't work.