Trying to set up a new macbook for a colleague. Not going well.
First I install OpenSSL:
Heathers-MacBook-Pro:~ heather$ rvm pkg install openssl
F
Here is what worked for me:
brew install rbenv/tap/openssl@1.0
rvm reinstall 1.9.3-p551 --with-openssl-dir='/usr/local/opt/openssl@1.0'
gem update --system
Cheers!
OP actually saved my day! In my case:
$ rvm pkg install openssl
$ rvm remove 2.4
$ rvm install 2.4 --with-openssl-dir=$HOME/.rvm/usr
$ gem install bundler
So this worked for me:
rvm pkg install openssl
rvm reinstall all --force
I also had rvm autolibs rvm_pkg for readline support.
openssl version: 1.0.2k
This worked for me:
brew reinstall openssl
Try this:
rvm get head
rvm pkg remove
rvm requirements run # if brew gives you warnings about formulas to install, run "brew install" for each before moving on.
rvm reinstall [the version you need (i.e: 2.0.0)]
For rvm on MacOS
First, check and see if you have openssl installed. You should see something like this:
$ brew --prefix openssl
/usr/local/opt/openssl@1.1
If openssl is not installed, do so.
$ brew install openssl
$ brew unlink openssl
$ brew link --force openssl
If you have more than one openssl installed, consider removing all but one to make your life easier.
$ brew cleanup openssl
$ brew list --versions openssl
$ brew uninstall <unwanted-openssl-version-here>
Now reinstall the ruby version, specifying the desired openssl path.
$ rvm reinstall <your-version-here> --with-openssl-dir=`brew --prefix openssl`
Finally, verify that your ruby was compiled with the same openssl it was linked to. If you see the same version twice, you should be all set.
$ ruby -ropenssl -e'puts OpenSSL::OPENSSL_VERSION, OpenSSL::OPENSSL_LIBRARY_VERSION'
OpenSSL 1.1.1d 10 Sep 2019
OpenSSL 1.1.1d 10 Sep 2019
If later you install other versions of ruby, you will need to pass the same --with-openssl-dir argument. Alternatively, I believe you can set the following variables in your bash profile.
export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:$(brew --prefix openssl)/lib/pkgconfig"
export LIBRARY_PATH="$LIBRARY_PATH:$(brew --prefix openssl)/lib"
If the above doesn't work, remove the lines from your bash profile and just use the --with-openssl-dir argument as above.
Ref: https://github.com/rvm/rvm/issues/4562 Ref: https://bugs.ruby-lang.org/issues/12630