Search code examples
ruby-on-railsrubywindowswindows-7compass

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


I cannot install compass. I want to install compass on my project so when I try to update, I get this:

c:\wamp\www\danjasnowski.com>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 returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed (https://api.rubygems.org/specs.4.8.gz)

Also.. my current version.

c:\wamp\www\danjasnowski.com>gem --version

2.4.1

and

irb(main):001:0> RUBY_VERSION

=> "2.0.0"

irb(main):002:0> RUBY_RELEASE_DATE

=> "2014-05-08"

irb(main):003:0> RUBY_PLATFORM

=> "x64-mingw32"

irb(main):004:0> RUBY_PATCHLEVEL

=> 481

irb(main):005:0>


Solution

  • 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