我有一個Rails應用程序,當用戶單擊按鈕時,向另一個網站發出ajax請求。在本地主機上它工作得很好,但在heroku
它沒有。它返回"We're sorry, but something went wrong."
(500),這裏是日誌對其他網站的Ajax請求不起作用在heroku
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-interrupted,其中sock field
等於client
。
這是爲什麼發生?
據我所知,ajax調用是瀏覽器和其他網站之間的連接。那麼你爲什麼認爲heroku在這裏很重要? – 2013-04-09 13:06:31
網站正在工作,但ajax呼叫不是。 – 2013-04-09 13:07:33