Heroku 日志没有显示任何错误,但我的大多数 URL 都显示“我们很抱歉,但出了点问题。”
我的应用程序在我的本地计算机上运行得很好,但是当我将应用程序推送到 Heroku 后创建第一篇帖子时,我得到“我们很抱歉,但出了点问题”。除了 /posts/new
之外的所有页面上 heroku logs
命令显示:
2011-05-30T19:24:02+00:00 heroku[api]: Set maintenance mode off by [email protected]
2011-05-30T19:24:04+00:00 heroku[web.1]: Unidling
2011-05-30T19:24:04+00:00 heroku[web.1]: State changed from created to starting
2011-05-30T19:24:08+00:00 heroku[web.1]: Starting process with command: `thin -p 54761 -e production -R /home/heroku_rack/heroku.ru start`
2011-05-30T19:24:16+00:00 heroku[web.1]: State changed from starting to up
2011-05-30T19:24:17+00:00 heroku[router]: GET mywebsite.com/ dyno=web.1 queue=0 wait=0ms service=1172ms bytes=934
2011-05-30T19:24:17+00:00 heroku[router]: GET mywebsite.com/ dyno=web.1 queue=1 wait=1171ms service=58ms bytes=934
2011-05-30T19:26:27+00:00 heroku[router]: GET mywebsite.com/new dyno=web.1 queue=0 wait=0ms service=18ms bytes=4324
2011-05-30T19:26:27+00:00 heroku[router]: GET mywebsite.com/stylesheets/style.css dyno=web.1 queue=0 wait=0ms service=1ms bytes=5716
2011-05-30T19:26:28+00:00 heroku[router]: GET mywebsite.com/javascripts/jquery-ui-1.8.13.custom.min.js dyno=web.1 queue=0 wait=0ms service=8ms bytes=20496
2011-05-30T19:26:28+00:00 heroku[router]: GET mywebsite.com/javascripts/rails.js dyno=web.1 queue=0 wait=0ms service=1ms bytes=12951
2011-05-30T19:26:28+00:00 heroku[router]: GET mywebsite.com/stylesheets/jquery-ui-1.8.13.custom.css dyno=web.1 queue=0 wait=0ms service=9ms bytes=21082
2011-05-30T19:26:28+00:00 heroku[router]: GET mywebsite.com/images/newlogo.png dyno=web.1 queue=0 wait=0ms service=4ms bytes=2804
2011-05-30T19:27:18+00:00 heroku[router]: GET mywebsite.com/robots.txt dyno=web.1 queue=0 wait=0ms service=1ms bytes=455
2011-05-30T12:27:19-07:00 heroku[nginx]: GET /robots.txt HTTP/1.1 | 207.46.195.229 | 486 | http | 200
2011-05-30T19:27:59+00:00 heroku[router]: GET mywebsite.com/ dyno=web.1 queue=0 wait=0ms service=32ms bytes=934
2011-05-30T12:27:59-07:00 heroku[nginx]: GET / HTTP/1.1 | 207.46.195.229 | 965 | http | 500
2011-05-30T19:29:18+00:00 heroku[router]: GET mywebsite.com/ dyno=web.1 queue=0 wait=0ms service=21ms bytes=934
2011-05-30T12:29:19-07:00 heroku[nginx]: GET / HTTP/1.1 | 24.16.162.252 | 965 | http | 500
2011-05-30T19:29:28+00:00 heroku[router]: GET mywebsite.com/ dyno=web.1 queue=0 wait=0ms service=30ms bytes=934
2011-05-30T12:29:29-07:00 heroku[nginx]: GET / HTTP/1.0 | 207.46.195.229 | 965 | http | 500
2011-05-30T19:34:45+00:00 heroku[router]: GET mywebsite.com/posts dyno=web.1 queue=0 wait=0ms service=46ms bytes=934
2011-05-30T19:34:53+00:00 heroku[router]: GET mywebsite.com/posts/1 dyno=web.1 queue=0 wait=0ms service=45ms bytes=934
由于假期,Heroku 客户服务今天无法使用。我想知道是否有人知道我该如何解决这个问题。我已启用扩展日志记录。
My app works wonderfully on my local machine but when I create my first post after pushing the app to Heroku I get "We're sorry, but something went wrong." on every page except /posts/new
The heroku logs
command reveals:
2011-05-30T19:24:02+00:00 heroku[api]: Set maintenance mode off by [email protected]
2011-05-30T19:24:04+00:00 heroku[web.1]: Unidling
2011-05-30T19:24:04+00:00 heroku[web.1]: State changed from created to starting
2011-05-30T19:24:08+00:00 heroku[web.1]: Starting process with command: `thin -p 54761 -e production -R /home/heroku_rack/heroku.ru start`
2011-05-30T19:24:16+00:00 heroku[web.1]: State changed from starting to up
2011-05-30T19:24:17+00:00 heroku[router]: GET mywebsite.com/ dyno=web.1 queue=0 wait=0ms service=1172ms bytes=934
2011-05-30T19:24:17+00:00 heroku[router]: GET mywebsite.com/ dyno=web.1 queue=1 wait=1171ms service=58ms bytes=934
2011-05-30T19:26:27+00:00 heroku[router]: GET mywebsite.com/new dyno=web.1 queue=0 wait=0ms service=18ms bytes=4324
2011-05-30T19:26:27+00:00 heroku[router]: GET mywebsite.com/stylesheets/style.css dyno=web.1 queue=0 wait=0ms service=1ms bytes=5716
2011-05-30T19:26:28+00:00 heroku[router]: GET mywebsite.com/javascripts/jquery-ui-1.8.13.custom.min.js dyno=web.1 queue=0 wait=0ms service=8ms bytes=20496
2011-05-30T19:26:28+00:00 heroku[router]: GET mywebsite.com/javascripts/rails.js dyno=web.1 queue=0 wait=0ms service=1ms bytes=12951
2011-05-30T19:26:28+00:00 heroku[router]: GET mywebsite.com/stylesheets/jquery-ui-1.8.13.custom.css dyno=web.1 queue=0 wait=0ms service=9ms bytes=21082
2011-05-30T19:26:28+00:00 heroku[router]: GET mywebsite.com/images/newlogo.png dyno=web.1 queue=0 wait=0ms service=4ms bytes=2804
2011-05-30T19:27:18+00:00 heroku[router]: GET mywebsite.com/robots.txt dyno=web.1 queue=0 wait=0ms service=1ms bytes=455
2011-05-30T12:27:19-07:00 heroku[nginx]: GET /robots.txt HTTP/1.1 | 207.46.195.229 | 486 | http | 200
2011-05-30T19:27:59+00:00 heroku[router]: GET mywebsite.com/ dyno=web.1 queue=0 wait=0ms service=32ms bytes=934
2011-05-30T12:27:59-07:00 heroku[nginx]: GET / HTTP/1.1 | 207.46.195.229 | 965 | http | 500
2011-05-30T19:29:18+00:00 heroku[router]: GET mywebsite.com/ dyno=web.1 queue=0 wait=0ms service=21ms bytes=934
2011-05-30T12:29:19-07:00 heroku[nginx]: GET / HTTP/1.1 | 24.16.162.252 | 965 | http | 500
2011-05-30T19:29:28+00:00 heroku[router]: GET mywebsite.com/ dyno=web.1 queue=0 wait=0ms service=30ms bytes=934
2011-05-30T12:29:29-07:00 heroku[nginx]: GET / HTTP/1.0 | 207.46.195.229 | 965 | http | 500
2011-05-30T19:34:45+00:00 heroku[router]: GET mywebsite.com/posts dyno=web.1 queue=0 wait=0ms service=46ms bytes=934
2011-05-30T19:34:53+00:00 heroku[router]: GET mywebsite.com/posts/1 dyno=web.1 queue=0 wait=0ms service=45ms bytes=934
Heroku customer service isn't available today due to the holiday. I was wondering if anyone knows how I might troubleshoot this. I have expanded logging enabled.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这并不是对上面问题的直接回答,而是更多针对为什么 Heroku 上的日志不够详细的相关问题。
对于那些像我一样到达这篇 SO 帖子的人,因为他们的日志稀疏并且无法理解为什么,并且拥有 Rails 4,请注意 您的
Gemfile
中需要有rails_12factor gem,以便在 Heroku 中获取详细的调试级别日志日志。本质上,添加 gem 可以在 Rails4 中启用 STDOUT 日志记录,否则您的调试级别日志信息不会传递到 Heroku 日志中。另外,当然,您必须在
config/environments/Production.rb
文件中启用日志级别调试:This is not a direct answer to the question above, but more for the related issue of why logs on Heroku are not detailed enough.
For those who arrive at this SO post, as I did, because they have sparse logs and can't understand why, and have Rails 4, note that you need the rails_12factor gem in your
Gemfile
in order to get detailed debug level logs in your Heroku logs. Essentially, adding the gem enables STDOUT logging in Rails4, without which your debug level logs information is not passed into the Heroku logs.Plus, of course, you have to enable log level debugging in your
config/environments/production.rb
file:如果日志中没有显示任何内容,则您的应用程序可能在启动时出现某种问题。
尝试在本地以生产模式运行它,看看启动服务器时是否会产生异常。
If nothing appears in the logs it is likely that your app has some sort of issue starting up.
Try running it in production mode locally, see if anything generates an exception when starting up the server.