简体   繁体   中英

rvm: certificate verify failed when installing Rails

For the first time, I am trying ruby-2.3.0 . I installed it from rvm. After installation, I try to install Rails:

$ rvm-prompt
ruby-2.3.0@mygemset

$ rvm osx-ssl-certs update all
Updating certificates for /etc/openssl/cert.pem: Updating certificates in '/etc/openssl/cert.pem'.
Updated.
Updating certificates for /usr/local/etc/openssl/cert.pem: Already up to date.

$ rvm rubygems latest
Installed rubygems 2.5.1 is newer than 2.4.8 provided with installed ruby, skipping installation, use --force to force installation.

$ gem install rails
ERROR:  Could not find a valid gem 'rails' (>= 0), here is why:
          Unable to download data from https://rubygems.org/ - SSL_connect returned=1 errno=0 state=error: certificate verify failed (https://api.rubygems.org/specs.4.8.gz)

Why am I receiving the error certificate verify failed ? When I navigate to the link https://api.rubygems.org/specs.4.8.gz on the browser, it downloads without problem.

Have a look here https://gist.github.com/luislavena/f064211759ee0f806c88 (see also Issue #1050 on the rubygems gem repo itself: https://github.com/rubygems/rubygems/issues/1050 if you want some great bedtime reading )

The gist (no pun intended) is that RubyGems had to update their SSL Certificate in a manner which was not deployable via rubygems itself.

You will need to do a 1 time manual installation / update of rubygems

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM