【发布时间】:2015-03-15 17:21:54
【问题描述】:
我的 Ruby on Rails 应用程序在 cloud9 上的开发中运行良好。当我推送到 Heroku 时,应用程序立即崩溃。 “heroku 日志”显示:
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=
我尝试过使用 unicorn 和 puma,两者都与 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 development 运行良好,rails s -e production 立即崩溃,并且没有任何记录(我可以找到)
【问题讨论】:
-
您是否尝试通过在 Cloud9 中运行生产来调试您的应用程序?可以吗?
标签: ruby-on-rails-3 heroku cloud9-ide