Windows 7 64-Bit: Could Not Find a Valid Gem 'Compass' (>= 0), Here Is Why: Unable to Download Data from Https://Rubygems.Org/

Windows 7 64-bit: Could not find a valid gem 'compass' ( = 0), here is why: Unable to download data from https://rubygems.org/

Try upgrading your SSL certificates.

  1. Download http://curl.haxx.se/ca/cacert.pem

  2. Save this file anywhere you want, such as:

    C:\cacert.pem
  3. On the command line, tell Ruby where to find the cert file, such as:

    set SSL_CERT_FILE=C:\cacert.pem
  4. Try again.

    gem install compass
  5. If it works, you can make the cert file permanent by adding it in your control panel.

Credit and more info: https://gist.github.com/fnichol/867550

Windows 10 64-bit: ERROR: Could not find a valid gem 'compass' ( = 0), here is why:

Place this file cacert.pem somewhere in your Ruby folder

and then create environmental variable and give the path of this file such as

Sample Image

Then it will work.

Could not find a valid gem 'rhc'. SSL_connect server certificate verify failed on Windows, Unable to connect OpenShift Server

The problem is that your Windows machine does not recognize the rubygems server certificate as a trusted certificate because Windows don't have its authority certificate present in its trusted certs store.

As a quick fix you'd need to remove the HTTPS version of the rubygems source URL (not HTTP as you did):

gem sources -r https://rubygems.org

This quick fix should make rubygems use the HTTP version which has no certificate checks involved.

But this should not be the definitive fix. Instead you should add the HTTPS source back (using the -a option) and install a proper CA certificate for the rubygems server cert into your windows trusted CA certs store.

There are quite a few pages that deal with this procedure on the net (google this), e.g. the post here has steps to download and install all CA certificates from the curl command, to your Windows machine, that fixes the problem permanently and without lowering security.

SSL Error When installing rubygems, Unable to pull data from 'https://rubygems.org/


For RVM & OSX users

Make sure you use latest rvm:

rvm get stable

Then you can do two things:

  1. Update certificates:

    rvm osx-ssl-certs update all
  2. Update rubygems:

    rvm rubygems latest

For non RVM users

Find path for certificate:

cert_file=$(ruby -ropenssl -e 'puts OpenSSL::X509::DEFAULT_CERT_FILE')

Generate certificate:

security find-certificate -a -p /Library/Keychains/System.keychain > "$cert_file"
security find-certificate -a -p /System/Library/Keychains/SystemRootCertificates.keychain >> "$cert_file"

The whole code: https://github.com/wayneeseguin/rvm/blob/master/scripts/functions/osx-ssl-certs


For non OSX users

Make sure to update package ca-certificates. (on old systems it might not be available - do not use an old system which does not receive security updates any more)

Windows note

The Ruby Installer builds for windows are prepared by Luis Lavena and the path to certificates will be showing something like C:/Users/Luis/... check https://github.com/oneclick/rubyinstaller/issues/249 for more details and this answer https://stackoverflow.com/a/27298259/497756 for fix.



Related Topics



Leave a reply



Submit