2

最初,我ruby 1.9.3在我的 Windows 7 中安装了版本,并且我最近安装ruby 2.0.0p195了并且从命令 promot ( ruby -v; ruby -e "puts 100"; irb) 进行了测试,效果很好。

ruby -vruby 2.0.0p195 (2013-05-14) [i386-mingw32]

gem -v给我2.0.2

当我尝试安装 rails 时,我总是收到以下错误:

http://rubygems.org

C:\Users\san>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)

或者

https://rubygems.org

C:\Users\san>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 问题的异常。请就此提出建议。谢谢!

4

1 回答 1

3

问题可能是因为您位于阻止您从 ruby​​gems.org 下载的代理/防火墙后面。有关类似问题,请参阅 ruby​​gems.org 上的以下主题:

http://help.rubygems.org/discussions/problems/799-ruby-gem-install-problems-on-windows-xp

安装时尝试使用 --http-proxy 选项。

对于无法通过 --http-proxy 使其工作的人,请尝试以下操作。从下面的评论中添加。

gem install rails --http-proxy --source http://rubygems.org --debug -v
于 2013-06-08T05:21:14.310 回答