Unable to require openssl, install OpenSSL and rebuild ruby (preferred) or use non-HTTPS sources

使用rvm安装ruby,gem install bundler 时报错,如下:

ERROR:  While executing gem ... (Gem::Exception)
    Unable to require openssl, install OpenSSL and rebuild ruby (preferred) or use non-HTTPS sources

自动编译,解决办法如下:

cd ruby-2.3.8
./configure  --with-openssl-dir=/usr/local/ssl
make
sudo make install

Mac brew安装方式,解决办法如下:

brew install openssl
rvm reinstall 2.3.8 --with-openssl-dir=`brew --prefix openssl`

你可能感兴趣的:(Unable to require openssl, install OpenSSL and rebuild ruby (preferred) or use non-HTTPS sources)