gem install cannot download from rubygems.org

user3567761 picture user3567761 · Dec 3, 2014 · Viewed 19k times · Source

When I type

gem install sass

I get the following error message

C:>gem install compass ERROR: Could not find a valid gem 'compass' (>= 0), here is why: Unable to download data from https://rubygems.org/ - SSL_connect retur ned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed ( https://rubygems.org/latest_specs.4.8.gz)

Answer

Pete picture Pete · Dec 18, 2014

I have experienced the same symptoms on Win7, Ruby 2.1.5 64bit - different gem, but same error message.

In my case, I had to install a new root certificate for rubygems, this link describes how:

https://gist.github.com/luislavena/f064211759ee0f806c88

The reason is that the ruby installation contains its own set of root certificates which are used when establishing secure connection with rubygems.org - but the certificate has since been changed on the server - so none of the root certificates that comes with this ruby installer can validate the server certificate. That is why you need to update the root certificate.