最初,我ruby 1.9.3
在我的 Windows 7 中安装了版本,并且我最近安装ruby 2.0.0p195
了并且从命令 promot ( ruby -v; ruby -e "puts 100"; irb
) 进行了测试,效果很好。
ruby -v
给ruby 2.0.0p195 (2013-05-14) [i386-mingw32]
gem -v
给我2.0.2
当我尝试安装 rails 时,我总是收到以下错误:
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)
或者
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 问题的异常。请就此提出建议。谢谢!