2011-05-30 73 views
3

我的應用程序奇妙地在我的本地機器上工作,但是當我將應用程序推送到Heroku後創建我的第一篇文章時,我得到「我們很抱歉,但出錯了。」每一頁上除了/posts/newheroku logs命令顯示:Heroku日誌顯示沒有錯誤,但我的大部分網址都顯示「很抱歉,但出錯了。」

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的客戶服務不可用今天因假期。我想知道是否有人知道我會如何解決這個問題。我已擴展日誌記錄功能。

回答

2

如果日誌中沒有任何內容出現,那麼您的應用可能會出現某種問題。

嘗試在本地生產模式下運行它,查看是否有任何東西在啓動服務器時生成異常。

rails server -e production 
+0

它看起來像所有我需要做的是一個'Heroku的耙分貝:創建:all'和'heroku rake db:reset'感謝您的幫助。 – BasicObject 2011-05-30 22:56:00

3

這不是直接回答上面的問題,但更多的的爲什麼不夠詳細在Heroku上的日誌相關的問題。

對於那些誰在這抵達SO後,像我一樣,因爲他們有稀疏的日誌,不明白爲什麼,有軌道4,注意you need the rails_12factor gemGemfile,以獲得詳細的調試級別日誌在你的Heroku日誌中。從本質上講,添加gem可以在Rails4中啓用STDOUT日誌記錄,否則,調試級別日誌信息不會傳遞到Heroku日誌中。

另外,當然,您必須啓用日誌級別調試在config/environments/production.rb文件:

config.log_level = :debug 
相關問題