2
votes

Im on OSX 10.10.5 and using RVM and ruby version 2.3.1. When i run gem install <gem_name> i get the following error

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)

I tried with different versions of ruby but still get the same error. When i run the following command

rvm osx-ssl-certs status all

I get:

Certificates for /etc/openssl/cert.pem: Up to date.
Certificates for /usr/local/etc/openssl/cert.pem: Up to date.

I have done rvm osx-ssl-certs update all again but still the error persists. Also trying to do gem update --system gives the same error.

The output of ruby -ropenssl -e 'p OpenSSL::OPENSSL_VERSION' is "OpenSSL 1.0.2h 3 May 2016"

Any way to fix this ?

Thank You

1
Finally this is fixed for me. For anyone else facing the same issue, what worked for me is github.com/tenex/rails-assets/issues/239#issuecomment-87108900 .jimcgh

1 Answers

1
votes

I had this same problem, the only way it work for me is to download the most updated rubygem from official website, then running the following command:

  1. Download gem from rubygems
  2. Unpack rubygem zip file into any directory
  3. cd into the unpacked rubygem folder
  4. Install with: ruby setup.rb (you may need admin/root privilege)
  5. Enter sudo gem update --system (to test you have most updated rubygem)

...After last step, it responded with Latest version currently installed. Aborting yay! Hope this helps :)