这不是代码中的错误,因为当我刷新页面时,页面最终呈现成功(即状态200)。有时它是1次刷新,但在获得200次之前最多可刷新4次。
我认为这是数据库,因为我使用了ClearDB的免费计划,但是我升级到ClearDB的下一个更好的I / O性能计划,它仍然会发生。
解决方案
如果您位于控制台 heroku run console 中,是否会出现相同的错误?我从来没有见过这个。尝试升级您的Mysql gem,您使用的是 api.rubyonrails/ classes / ActiveRecord / StatementInvalid.html 我认为正确的是mysql2 rubygems/gems / mysql2
I recently switched from Heroku's Bamboo stack to the Cedar one (Rails 3.1.4, Ruby 1.9.2, Thin gem for web server). Since then I keep getting 500 errors such as this, where it seems that the query is not acting right:
207 <13>1 2012-05-06T16:10:51+00:00 d. app web.1 - - ActiveRecord::StatementInvalid (Mysql::Error: : SELECT `foos`.* FROM `foos` WHERE `foos`.`id` = ? LIMIT 1)It's not an error in the code though because the page eventually renders successfully (ie status 200) when I refresh the page. Sometimes it is 1 refresh, but can get up to 4 refreshes before I get a 200.
I thought it was the database because I was on ClearDB's free plan, but I upgraded to ClearDB's next plan with better I/O performance and it still happens
解决方案
Do you get the same errors if you are in console heroku run console ? I've never seen this before. Try upgrading your Mysql gem, which one are you using api.rubyonrails/classes/ActiveRecord/StatementInvalid.html i think the correct one is mysql2 rubygems/gems/mysql2
更多推荐
Heroku常数500错误
发布评论