-2

我有一个 Rails 应用程序,当用户单击按钮时,它会向其他网站发出 ajax 请求。在本地主机上它工作得很好,但heroku它没有。它返回"We're sorry, but something went wrong."(500),这是日志

Processing by HomeController#some_request as */*
2013-04-09T12:42:33.050720+00:00 app[web.1]:   Parameters: {"q"=>"another_web_site.com"}
2013-04-09T12:42:33.048011+00:00 app[web.1]: Started POST "/ajax/some_request" for 180.183.158.162 at 2013-04-09 12:42:33 +0000
2013-04-09T12:42:29.793791+00:00 heroku[router]: at=info method=GET path=/assets/application.js host=my_host.org fwd="180.183.158.162" dyno=web.1 connect=1ms service=5ms status=304 bytes=0
2013-04-09T12:42:54.057280+00:00 app[web.1]: 
2013-04-09T12:42:54.057280+00:00 app[web.1]: Errno::ETIMEDOUT (Connection timed out - connect(2)):
2013-04-09T12:42:54.057280+00:00 app[web.1]: 
2013-04-09T12:42:54.057280+00:00 app[web.1]: 
2013-04-09T12:42:54.057280+00:00 app[web.1]:   lib/domain_info.rb:14:in `who_is'
2013-04-09T12:42:54.057280+00:00 app[web.1]:   app/controllers/home_controller.rb:8:in `who_is'
2013-04-09T12:42:54.055802+00:00 app[web.1]: Completed 500 Internal Server Error in 21004ms
2013-04-09T12:42:54.059787+00:00 heroku[router]: at=info method=POST path=/ajax/some_request host=my_host.org fwd="180.183.158.162" dyno=web.1 connect=2ms service=21017ms status=500 bytes=643

现在是超时了。就在昨天,它是https://devcenter.heroku.com/articles/error-codes#h18-request-interruptedsock field等于client.

为什么会这样?

4

1 回答 1

0

无论您的应用程序在做什么lib/domain_info.rb都会超时 - 您确定代码在您的机器/本地主机以外的位置工作吗?这段代码在做什么?分享会很有帮助。

于 2013-04-09T15:10:15.270 回答