在Windows上的Ruby网络问题
我运行Windows XP的红宝石1.8.6 patchlevel 111.我使用HTTP连接到远程服务器,它一直运行良好。 突然之间,它开始通过下面列出的例外(自从我上次成功运行后,我没有更改任何代码)。 有人知道发生了什么吗?
c:/ruby/lib/ruby/1.8/timeout.rb:54:in `rbuf_fill': execution expired (Timeout::E rror) from c:/ruby/lib/ruby/1.8/timeout.rb:56:in `timeout' from c:/ruby/lib/ruby/1.8/timeout.rb:76:in `timeout' from c:/ruby/lib/ruby/1.8/net/protocol.rb:132:in `rbuf_fill' from c:/ruby/lib/ruby/1.8/net/protocol.rb:116:in `readuntil' from c:/ruby/lib/ruby/1.8/net/protocol.rb:126:in `readline' from c:/ruby/lib/ruby/1.8/net/http.rb:2029:in `read_status_line' from c:/ruby/lib/ruby/1.8/net/http.rb:2018:in `read_new' from c:/ruby/lib/ruby/1.8/net/http.rb:1059:in `request' ... 19 levels... from c:/ruby/lib/ruby/1.8/test/unit/autorunner.rb:216:in `run' from c:/ruby/lib/ruby/1.8/test/unit/autorunner.rb:12:in `run' from c:/ruby/lib/ruby/1.8/test/unit.rb:278 from c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake/rake_test_loader .rb:5 rake aborted! Command failed with status (3): [c:/ruby/bin/ruby -Ilib;test "c:/ruby/lib/r...]
也许远程主机关闭了? 或者您的机器和远程主机之间放置了新的防火墙?
“Timeout :: Error”通常指向那个方向。
除了明显的(防火墙,你被列入坏的用户代理或忽略robots.txt的黑名单),你可以尝试卷曲
http://curl.haxx.se/libcurl/ruby/
或者增加net / http超时,说30+秒
http://groups.google.com/group/rubyonrails-talk/msg/cc89e8ae6703d6fb
它可能与这个已知的Ruby错误有关,其中Timeout :: Error不属于Exception的子类。 (我相信固定在1.9.2)
http://lindsaar.net/2007/12/9/rbuf_filltimeout-error
它可以通过从Timeout :: Error像rescue Timeout::Error => e
来解决