【发布时间】:2014-11-15 21:55:19
【问题描述】:
我有一个可以在本地运行但不能在 heroku 上正常运行的应用程序。根页面加载,但是当我尝试提交链接时,Heroku 给我“我们很抱歉,但出了点问题。 如果您是应用程序所有者,请查看日志以获取更多信息。”
查看日志,这似乎是一个资产问题,我运行了“RAILS_ENV=production bundle exec rake assets:precompile”,但我仍然收到这些日志错误。
2014-09-22T01:09:39.694028+00:00 app[web.1]: [2014-09-22 01:09:39] INFO WEBrick 1.3.1
2014-09-22T01:09:39.694047+00:00 app[web.1]: [2014-09-22 01:09:39] INFO ruby 2.0.0 (2014- 09-19) [x86_64-linux]
2014-09-22T01:09:39.694487+00:00 app[web.1]: [2014-09-22 01:09:39] INFO WEBrick::HTTPServer#start: pid=2 port=24344
2014-09-22T01:09:39.797519+00:00 heroku[web.1]: State changed from starting to up
2014-09-22T01:09:40.724903+00:00 heroku[router]: at=info method=GET path="/" host=findmegnar.herokuapp.com request_id=502f7e98-22da-4825-ad85-77606ab64cca fwd="54.162.73.140" dyno=web.1 connect=2ms service=130ms status=200 bytes=1907
2014-09-22T01:09:44.875965+00:00 heroku[router]: at=info method=GET path="/" host=findmegnar.herokuapp.com request_id=900ca4d9-db6c-4c53-aeb4-f6e50c0a7e4f fwd="74.95.112.118" dyno=web.1 connect=0ms service=16ms status=304 bytes=733
2014-09-22T01:09:44.978618+00:00 heroku[router]: at=info method=GET path="/assets/application-cb25950d0e442f07f1fa7be553c321c3.css" host=findmegnar.herokuapp.com request_id=13b510e0-f3c8-4f1a-8a29-9d99a30fb794 fwd="74.95.112.118" dyno=web.1 connect=1ms service=9ms status=404 bytes=1829
2014-09-22T01:09:44.987883+00:00 heroku[router]: at=info method=GET path="/assets/application-433aac58cfba85b04e81533418015cc6.js" host=findmegnar.herokuapp.com request_id=2cbaa67e-646e-4faf-adee-c9c4606fe662 fwd="74.95.112.118" dyno=web.1 connect=0ms service=6ms status=404 bytes=1829
2014-09-22T01:09:47.967521+00:00 heroku[router]: at=info method=POST path="/searches" host=findmegnar.herokuapp.com request_id=2948d744-102f-420b-a856-63a55ab3e0c5 fwd="74.95.112.118" dyno=web.1 connect=1ms service=16ms status=500 bytes=1754
编辑:进一步的工作发现这个错误是由于缺少数据库引起的。跑步 heroku 运行 rake db:reset 修复了那个问题。然而,运行 heroku 运行 rake 导入:度假村
对我想添加到数据中的数据进行了 rake 导入,但实际上并没有将数据添加到数据库中。
有谁知道在heroku中是否有一种特殊的方式来做rake任务?
【问题讨论】:
-
我似乎记得必须先运行“rake assets:clean”,然后再运行“rake assets:precompile RAILS_ENV=development”才能解决问题。
-
道歉-以上应该是ENV=production
-
通过开发环境登录 Herokuvia。 Thue se 命令,例如“heroku 运行 rake 资产:预编译”
标签: ruby-on-rails ruby heroku