简体   繁体   English

Windows 7 64位:找不到有效的宝石'指南针'(> = 0),原因如下:无法从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/

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 ) c:\\ wamp \\ www \\ danjasnowski.com> gem install compass错误:找不到有效的宝石'指南针'(> = 0),原因如下:无法从https://rubygems.org/下载数据 - SSL_connect返回= 1 errno = 0状态= SSLv3读取服务器证书B:证书验证失败( https://api.rubygems.org/specs.4.8.gz

Also.. my current version. 另外..我目前的版本。

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

2.4.1 2.4.1

and

irb(main):001:0> RUBY_VERSION irb(main):001:0> RUBY_VERSION

=> "2.0.0" =>“2.0.0”

irb(main):002:0> RUBY_RELEASE_DATE irb(main):002:0> RUBY_RELEASE_DATE

=> "2014-05-08" >“2014-05-08”

irb(main):003:0> RUBY_PLATFORM irb(主要):003:0> RUBY_PLATFORM

=> "x64-mingw32" >“x64-mingw32”

irb(main):004:0> RUBY_PATCHLEVEL irb(main):004:0> RUBY_PATCHLEVEL

=> 481 => 481

irb(main):005:0> IRB(主):005:0>

Try upgrading your SSL certificates. 尝试升级SSL证书。

  1. Download http://curl.haxx.se/ca/cacert.pem 下载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: 在命令行上,告诉Ruby在哪里找到cert文件,例如:

     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 信用和更多信息: 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. 对于不想处理SSL证书的懒人来说,只是一个额外的选项,您可以卸载并重新安装最新的ruby环境。 I used to have 1.8 something and reinstalling to 2.2.1 did the trick. 我曾经有过1.8的东西并重新安装到2.2.1就可以了。

link for windows 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. 我去了rubygems.org/pages/download并下载了压缩文件。 Then I unpacked it somewhere on my C: partition and opened it once I unpacked it. 然后我将它解压缩到我的C:分区的某个地方,打开它后打开它。 Find a file "setup.rb" and double click on it, it will install something, I don't remember. 找到一个文件“setup.rb”并双击它,它会安装一些东西,我不记得了。 I guess ruby gems. 我猜红宝石宝石。 Then close everything, go again and open cmd on windows and try typing "gem install sass". 然后关闭所有内容,再次打开并在Windows上打开cmd并尝试键入“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. 我的解决方案是这样的:我卸载了当前用于x64系统的ruby安装,并用ruby x86 / 32bit安装程序替换它,并按照@joelparkerhenderson给出的步骤进行操作。

Though I have x64 system, this is the only solution that worked for me. 虽然我有x64系统,但这是唯一对我有用的解决方案。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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