I’ll introduce how to resolve the “Could not load OpenSSL” error that occurred when running bundle install in a Ruby environment installed with RVM.
$ sw_vers
ProductName: Mac OS X
ProductVersion: 10.14.5
BuildVersion: 18F132
$ rvm version
rvm 1.29.8-next (master) by Michal Papis, Piotr Kuczynski, Wayne E. Seguin [https://rvm.io]
$ which openssl
/usr/bin/openssl
Could not load OpenSSL Error Message
$ bundle install
Could not load OpenSSL.
You must recompile Ruby with OpenSSL support or change the sources in your Gemfile from 'https' to 'http'. Instructions for compiling with OpenSSL using RVM are available at rvm.io/packages/openssl.
The solution is to install OpenSSL separately with rvm pkg install openssl
and configure the Ruby installation via rvm to use this OpenSSL.
rvm pkg install openssl
rvm remove 2.4
rvm install 2.4 --with-openssl-dir=$HOME/.rvm/usr
That’s all from the Gemba, where we resolved the “Could not load OpenSSL” error with RVM.