由于 windows 中的 openssl/ETimedout,gem install rails 不起作用 [英] gem install rails doesn't work due to openssl/ETimedout in windows
问题描述
最初,我在我的 Windows 7 中安装了 ruby 1.9.3
版本,并且我最近安装了 ruby 2.0.0p195
并通过命令 promot (ruby -v; ruby -e "puts 100"; irb
) 效果很好.
Initially, I have ruby 1.9.3
version installed in my windows 7 and i have installed ruby 2.0.0p195
recently and have tested from command promot (ruby -v; ruby -e "puts 100"; irb
)works pretty well.
ruby -v
给出 ruby 2.0.0p195 (2013-05-14) [i386-mingw32]
gem -v
给了我 2.0.2
当我尝试安装 Rails 时,我总是收到以下错误:
When i'm trying to install rails, I do always get the below error :
C:Userssan>gem install rails --source http://rubygems.org
ERROR: Could not find a valid gem 'rails' (>= 0), here is why:
Unable to download data from https://rubygems.org/ - Errno::ETIMEDOUT:
A connection attempt failed because the connected party did not properly respon
d after a period of time, or established connection failed because connected hos
t has failed to respond. - connect(2) (https://rubygems.org/latest_specs.4.8.gz)
或
C:Userssan>gem install rails --debug -V
Exception `Errno::EEXIST' at C:/Ruby200/lib/ruby/2.0.0/fileutils.rb:245 - File e
xists - C:/Users/san/.gem/specs/rubygems.org%443
HEAD https://rubygems.org/latest_specs.4.8.gz
Exception `OpenSSL::SSL::SSLError' at C:/Ruby200/lib/ruby/2.0.0/openssl/bufferin
g.rb:174 - read would block
302 Moved Temporarily
HEAD https://s3.amazonaws.com/production.s3.rubygems.org/latest_specs.4.8.gz
Exception `OpenSSL::SSL::SSLError' at C:/Ruby200/lib/ruby/2.0.0/openssl/bufferin
g.rb:174 - read would block
200 OK
GET https://rubygems.org/latest_specs.4.8.gz
Exception `Errno::ETIMEDOUT' at C:/Ruby200/lib/ruby/2.0.0/net/http.rb:878 - A co
nnection attempt failed because the connected party did not properly respond aft
er a period of time, or established connection failed because connected host has
failed to respond. - connect(2)
由于我遇到了这么多错误,我已经卸载了两个 ruby 版本并重新启动系统并重新安装(正如谷歌搜索和几个 stackoverflow 问题所建议的那样).但没有太大帮助.注意:我已关闭 Windows 防火墙并尝试安装.但是我仍然遇到 openSSL 问题的异常.请就此提出建议.谢谢!
Since i'm getting so many errors, I have uninstalled both ruby versions and rebooted system and installed back (as suggested after googling and from few stackoverflow questions). But didn't help much. Note: I have turned off windows firewall and tried installing. But I'm still getting Exception with openSSL issue. Please suggest on this. Thanks!
推荐答案
问题可能是因为您使用代理/防火墙阻止您从 rubygems.org 下载.有关类似问题,请参阅 rubygems.org 上的以下主题:
The problem could be because you are behind proxy/firewall that blocks you from downloading from rubygems.org. See the below thread on rubygems.org for similiar issue:
http://help.rubygems.org/discussions/problems/799-ruby-gem-install-problems-on-windows-xp
在安装时尝试使用 --http-proxy 选项.
Try using --http-proxy option while installing.
对于无法通过 --http-proxy 使其工作的人,请尝试以下操作.从下面的评论中添加.
For people who are not able to make it work through --http-proxy, try the below. Added from the comment below.
gem install rails --http-proxy --source http://rubygems.org --debug -v
这篇关于由于 windows 中的 openssl/ETimedout,gem install rails 不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!