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.
Download http://curl.haxx.se/ca/cacert.pem
Save this file anywhere you want, such as:
C:\cacert.pem
On the command line, tell Ruby where to find the cert file, such as:
set SSL_CERT_FILE=C:\cacert.pem
Try again.
gem install compass
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
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:
Update certificates:
rvm osx-ssl-certs update all
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
Convert an Array of Integers into an Array of Strings in Ruby
What's the Difference Between Process.Fork and Process.Spawn in Ruby 1.9.2
Using Helpers in Rails 3 to Output HTML
I Have a Gem Installed But Require 'Gemname' Does Not Work. Why
How to Get a Date from a Week Number
Hash Ordering Preserved Between Iterations If Not Modified
Check If Directory Is Empty in Ruby
Is There a Way Rails 3.0.X Can Default to Using Thin
Ruby Loaderror: Cannot Load Such File
How to Track Down a Memory Leak in My Ruby Code
(Ruby,Rails) Context of Self in Modules and Libraries...
Ruby Methods and Optional Parameters
What Does "Wrong Number of Arguments (1 for 0)" Mean in Ruby