程序抛出超时错误

时间:2014-10-10 08:25:57

标签: ruby-on-rails ruby api sockets timeout

我不知道是什么原因,但我的ruby程序突然抛出超时错误

/home/mounarajan/.rbenv/versions/2.1.2/lib/ruby/2.1.0/net/http.rb:879:in `initialize': execution expired (Net::OpenTimeout)
from /home/mounarajan/.rbenv/versions/2.1.2/lib/ruby/2.1.0/net/http.rb:879:in `open'
from /home/mounarajan/.rbenv/versions/2.1.2/lib/ruby/2.1.0/net/http.rb:879:in `block in connect'
from /home/mounarajan/.rbenv/versions/2.1.2/lib/ruby/2.1.0/timeout.rb:91:in `block in timeout'
from /home/mounarajan/.rbenv/versions/2.1.2/lib/ruby/2.1.0/timeout.rb:101:in `call'
from /home/mounarajan/.rbenv/versions/2.1.2/lib/ruby/2.1.0/timeout.rb:101:in `timeout'
from /home/mounarajan/.rbenv/versions/2.1.2/lib/ruby/2.1.0/net/http.rb:878:in `connect'
from /home/mounarajan/.rbenv/versions/2.1.2/lib/ruby/2.1.0/net/http.rb:863:in `do_start'
from /home/mounarajan/.rbenv/versions/2.1.2/lib/ruby/2.1.0/net/http.rb:852:in `start'
from /home/mounarajan/.rbenv/versions/2.1.2/lib/ruby/2.1.0/net/http.rb:1369:in `request'
from /home/mounarajan/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/oauth-0.4.7/lib/oauth/consumer.rb:161:in `request'
from /home/mounarajan/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/oauth-0.4.7/lib/oauth/tokens/consumer_token.rb:25:in `request'
from /home/mounarajan/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/oauth-0.4.7/lib/oauth/tokens/access_token.rb:12:in `request'
from /home/mounarajan/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/oauth-0.4.7/lib/oauth/tokens/access_token.rb:27:in `get'
from /home/mounarajan/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/semantics3-0.04/lib/semantics3.rb:36:in `_make_request'
from /home/mounarajan/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/semantics3-0.04/lib/semantics3.rb:217:in `run_query'
from /home/mounarajan/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/semantics3-0.04/lib/semantics3.rb:80:in `get_products'
from project.rb:34:in `block (2 levels) in <main>'
from project.rb:31:in `each'
from project.rb:31:in `each_with_index'
from project.rb:31:in `block in <main>'
from project.rb:30:in `open'
from project.rb:30:in `<main>'

请帮我解决这个问题

1 个答案:

答案 0 :(得分:0)

您访问的网络服务是否有效?

然后它可能无法使用,你只能等到再次出现。

如果您是第一次开发访问权限,可能是防火墙阻止了您,或者服务网址未正确编写