简体   繁体   English

gem install 无法从 ruby​​gems.org 下载

[英]gem install cannot download from rubygems.org

When I type当我打字

gem install sass宝石安装sass

I get the following error message我收到以下错误消息

C:>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 retur ned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed ( https://rubygems.org/latest_specs.4.8.gz ) C:>gem install compass 错误:找不到有效的 gem 'compass' (>= 0),原因如下:无法从https://rubygems.org/下载数据 - SSL_connect 返回 ned=1 errno=0 状态=SSLv3 读取服务器证书 B:证书验证失败( https://rubygems.org/latest_specs.4.8.gz

Use http instead of https 使用http而不是https

gem sources --remove https://rubygems.org/
gem sources -a http://rubygems.org/

I have experienced the same symptoms on Win7, Ruby 2.1.5 64bit - different gem, but same error message.我在 Win7、Ruby 2.1.5 64 位上遇到了相同的症状 - 不同的 gem,但相同的错误消息。

In my case, I had to install a new root certificate for rubygems, this link describes how:就我而言,我必须为 ruby​​gems 安装一个新的根证书,此链接描述了如何:

https://gist.github.com/luislavena/f064211759ee0f806c88 https://gist.github.com/luislavena/f064211759ee0f806c88

The reason is that the ruby installation contains its own set of root certificates which are used when establishing secure connection with rubygems.org - but the certificate has since been changed on the server - so none of the root certificates that comes with this ruby installer can validate the server certificate.原因是 ruby​​ 安装包含它自己的一组根证书,在与 ruby​​gems.org 建立安全连接时使用这些证书 - 但该证书已在服务器上更改 - 因此此 ruby​​ 安装程序附带的根证书都不能验证服务器证书。 That is why you need to update the root certificate.这就是您需要更新根证书的原因。

According to this post : SSL Error When installing rubygems, Unable to pull data from 'https://rubygems.org/根据这篇文章: 安装 ruby​​gems 时出现 SSL 错误,无法从“https://rubygems.org/”中提取数据

Goto link http://rubygems.org/pages/download转到链接http://rubygems.org/pages/download

Download the latest zip file下载最新的 zip 文件
Unzip it解压
run "ruby setup.rb" in unzipped folder在解压后的文件夹中运行“ruby setup.rb”
now run gem install command现在运行 gem install 命令

TL;DR Apply the official fix: TL;DR应用官方修复:

  1. Download https://rubygems.org/downloads/rubygems-update-2.6.7.gem下载https://rubygems.org/downloads/rubygems-update-2.6.7.gem
  2. Run:跑:

     gem install --local rubygems-update-2.6.7.gem update_rubygems --no-ri --no-rdoc gem uninstall rubygems-update -x

Long version长版

See http://guides.rubygems.org/ssl-certificate-update/ .请参阅http://guides.rubygems.org/ssl-certificate-update/

Basically it adds GlobalSignRootCA.基本上它添加了 GlobalSignRootCA。 Very easy to apply, unfortunately hard to google though.很容易申请,不幸的是很难谷歌。

I also noticed issues with rubygems.org yesterday (in one environment), but your error almost sounds like an issue with a newly-installed Ruby and its SSL integration/configuration (having it locate SSL during installation, as well as the necessary certificates).我昨天也注意到 ruby​​gems.org 的问题(在一个环境中),但是您的错误几乎听起来像是新安装的 Ruby 及其 SSL 集成/配置的问题(让它在安装过程中定位 SSL,以及必要的证书) .

You might check out:你可能会检查:

SSL Error When installing rubygems, Unable to pull data from 'https://rubygems.org/ SSL 错误 安装 ruby​​gems 时,无法从“https://rubygems.org/”中提取数据

But if that doesn't help I recommend continued searching, as this seems to be a common problem area.但如果这没有帮助,我建议继续搜索,因为这似乎是一个常见的问题领域。

I fix the problem using this method:我使用这种方法解决了这个问题:

http://help.rubygems.org/discussions/problems/19761-could-not-find-a-valid-gem http://help.rubygems.org/discussions/problems/19761-could-not-find-a-valid-gem

Try disabling Ipv6 on your system.尝试在您的系统上禁用 Ipv6。 If on Linux you can use these commands.如果在 Linux 上,您可以使用这些命令。

 sudo sysctl -w net.ipv6.conf.all.disable_ipv6=1
sudo sysctl -w net.ipv6.conf.default.disable_ipv6=1 

what rails do you use??你用什么导轨??

I think your problem is the version of rails.我认为你的问题是rails的版本。

I use:我用:

gem 'rails', '4.1.4'
gem 'sass-rails', '~> 4.0.3'

Some times https://rubygems.org is the problem I need to change for http://rubygems.org , I think the problems is for proxy.有时https://rubygems.org是我需要更改为http://rubygems.org的问题,我认为问题出在代理上。

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

相关问题 如何通过Rubygems.org安装gem的git头? - How to install the git head of a gem through Rubygems.org? 卡在从 http://rubygems.org/ 获取 gem 元数据 - Stuck at Fetching gem metadata from http://rubygems.org/ gem mongoid:无法从https://rubygems.org/获取规格 - gem mongoid : Could not fetch specs from https://rubygems.org/ 无法从http://rubygems.org/下载数据 - Unable to download data from http://rubygems.org/ 捆绑安装无法从 https://rubygems.org/ 获取规范 - Bundle Install could not fetch specs from https://rubygems.org/ 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/ 在捆绑之前确保 `gem install byebug -v '11.1.3' --source 'https://rubygems.org/'` 成功 - Make sure that `gem install byebug -v '11.1.3' --source 'https://rubygems.org/'` succeeds before bundling 无法设置 HTTP gem 源:“源 https://rubygems.org 不在缓存中” - Cannot set HTTP gem source: "source https://rubygems.org not present in cache" 即使在Ubuntu 14.04上的gem更新系统之后也无法从https://rubygems.org/获取数据 - Unable to get data from https://rubygems.org/ even after gem update system on ubuntu 14.04 gem呼叫始终超时(无法到达rubygems.org) - gem calls always timeout (can't reach rubygems.org)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM