我的应用程序在我的本地计算机上运行得非常好但是当我将应用程序推送到Heroku后创建我的第一篇文章时,我得到“我们很抱歉,但出了点问题。”在除/posts/new
之外的每个页面上heroku logs
命令显示:
2011-05-30T19:24:02+00:00 heroku[api]: Set maintenance mode off by myemailaddress@blah.com
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客户服务今天不可用。我想知道是否有人知道如何解决这个问题。我已启用扩展日志记录。
答案 0 :(得分:3)
这不是上述问题的直接答案,但更多的是关于为什么登录Heroku的相关问题不够详细。
对于那些到达此SO帖子的人,正如我所做的那样,因为他们有稀疏的日志并且无法理解原因,和有Rails 4,请注意you need the rails_12factor gem在{ {1}}以获取Heroku日志中的详细调试级别日志。本质上,添加gem可以在Rails4中启用STDOUT日志记录,如果没有这些日志,您的调试级别日志信息就不会传递到Heroku日志中。
Plus ,当然,您必须在Gemfile
文件中启用日志级调试:
config/environments/production.rb
答案 1 :(得分:2)
如果日志中没有任何内容,则您的应用可能会出现某种问题。
尝试在本地生产模式下运行它,看看在启动服务器时是否有任何异常生成。
rails server -e production