我的Ruby on Rails应用程序在cloud9上的开发中运行良好。当我推送到Heroku时,应用程序立即崩溃。 'heroku logs'显示:
2015-03-15T17:11:11.909831+00:00 heroku[web.1]: State changed from crashed to starting
2015-03-15T17:11:16.291267+00:00 heroku[web.1]: Starting process with command `bin/rails server -p 42991 -e production`
2015-03-15T17:11:20.262015+00:00 app[web.1]: => Booting Puma
2015-03-15T17:11:20.262090+00:00 app[web.1]: => Rails 4.2.0 application starting in production on http://0.0.0.0:42991
2015-03-15T17:11:20.264853+00:00 app[web.1]: Abort testing: Your Rails environment is running in production mode!
2015-03-15T17:11:20.264972+00:00 app[web.1]: Exiting
2015-03-15T17:11:20.262130+00:00 app[web.1]: => Run `rails server -h` for more startup options
2015-03-15T17:11:20.262170+00:00 app[web.1]: => Ctrl-C to shutdown server
2015-03-15T17:11:21.206693+00:00 heroku[web.1]: State changed from starting to crashed
2015-03-15T17:11:21.193413+00:00 heroku[web.1]: Process exited with status 1
2015-03-15T17:11:22.003251+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=agile-plateau-9101.herokuapp.com request_id=2889a78c-9ccf-4583-ac2b-978683cab62e fwd="149.151.180.124" dyno= connect= service= status=503 bytes=
2015-03-15T17:11:22.536224+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=agile-plateau-9101.herokuapp.com request_id=355eeb91-1fb6-410c-a169-3407d7c2af67 fwd="149.151.180.124" dyno= connect= service= status=503 bytes=
我尝试使用独角兽和美洲狮,两者都使用Heroku提供的.rb文件,没有运气。我甚至无法在Heroku上运行控制台。 IDE中的“heroku run rails console”显示“运行rails console
连接到终端... up,run.9870”然后将我带回IDE控制台,而不是Heroku的。控制台命令的Heroku日志是:
2015-03-15T17:16:48.811613+00:00 heroku[api]: Starting process with command `rails console` by msandford@gmail.com
2015-03-15T17:16:54.386969+00:00 heroku[run.9870]: Awaiting client
2015-03-15T17:16:54.550213+00:00 heroku[run.9870]: Starting process with command `rails console`
2015-03-15T17:16:54.772282+00:00 heroku[run.9870]: State changed from starting to up
2015-03-15T17:17:01.220393+00:00 heroku[run.9870]: State changed from up to complete
2015-03-15T17:17:01.207230+00:00 heroku[run.9870]: Process exited with status 1
有关从何处开始排除故障的任何建议?
编辑:我在EC2上设置了一个Ubuntu服务器,在开发和生产中运行时,我得到了完全相同的东西。我正在使用pg。 rails s -e开发运行正常,rails s -e生产立即崩溃,没有任何记录(我能找到)
答案 0 :(得分:0)
我已经解决了这个问题:我必须在环境中注释掉“require'trail / test_help'”,然后一切都很顺利。