简体   繁体   中英

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>

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

Just an additional option for lazy people who don't want to deal with the SSL certificates, you can just uninstall and re-install the latest ruby environment. I used to have 1.8 something and reinstalling to 2.2.1 did the trick.

link for windows

If there are still guys like me that can't find solution in any of the comments before mine, here's how I found my working way:

I went to rubygems.org/pages/download and downloaded zipped file. Then I unpacked it somewhere on my C: partition and opened it once I unpacked it. Find a file "setup.rb" and double click on it, it will install something, I don't remember. I guess ruby gems. Then close everything, go again and open cmd on windows and try typing "gem install sass". It worked for me. Sass installed. :)

Hope I will help someone, because I lost my mind looking for solution to this problem whole day today. :)

My solution was this: I uninstalled my current ruby installation which is for x64 system and replaced it with ruby x86/32bit installer and followed the steps given by @joelparkerhenderson.

Though I have x64 system, this is the only solution that worked for me.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM