Can't run Ruby 2.2.3 with RVM on OSX

若如初见. 提交于 2019-12-01 03:21:30

Downloading http://curl.haxx.se/ca/cacert.pem and adding

export SSL_CERT_FILE=PATH_TO_THe_DOWNLOADED_FILE/cacert.pem

to the .bash_profile/.zshrc partially fixed the issue, because it throws the following error on my system:

Excon::Errors::SocketError: Unable to verify certificate, please set `Excon.defaults[:ssl_ca_path] = path_to_certs`, `ENV['SSL_CERT_DIR'] = path_to_certs`, `Excon.defaults[:ssl_ca_file] = path_to_file`, `ENV['SSL_CERT_FILE'] = path_to_file`, `Excon.defaults[:ssl_verify_callback] = callback` (see OpenSSL::SSL::SSLContext#verify_callback), or `Excon.defaults[:ssl_verify_peer] = false` (less secure).

Setting Excon.defaults[:ssl_verify_peer] to false in a Rails initializer (only on development/test envs) makes it work.

Update: Reinstalling 2.2.3 from source got rid of all my problems.

rvm remove 2.2.3
rvm install 2.2.3 --disable-binary

Couldn't help myself otherwise than with brew install openssl on El Capitan. I've tried everything like updating certs using RVM, replacing SSL certs from haxx.se, or reinstalling ruby. Nothing else worked.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!