我正在尝试将我的Ruby on Rails
webbapp 部署到 Heroku。在本地它工作得很好,但是当我尝试通过 Heroku 运行它时,它给了我一个 H10 错误 HTTP 状态 503。我猜这是因为bash: bundle: command not found
. 但即使跑步heroku run bundle exec rails server -p $PORT
也行不通。
2016-04-26T11:35:09.570021+00:00 heroku[slug-compiler]: Slug compilation started
2016-04-26T11:35:09.570027+00:00 heroku[slug-compiler]: Slug compilation failed: failed to compile Ruby app
2016-04-26T11:36:34.435961+00:00 heroku[slug-compiler]: Slug compilation started
2016-04-26T11:36:34.435967+00:00 heroku[slug-compiler]: Slug compilation failed: failed to compile Ruby app
2016-04-26T11:37:06.665673+00:00 heroku[slug-compiler]: Slug compilation started
2016-04-26T11:37:06.665682+00:00 heroku[slug-compiler]: Slug compilation failed: failed to compile Ruby app
2016-04-26T11:37:20.446113+00:00 heroku[slug-compiler]: Slug compilation started
2016-04-26T11:37:20.446119+00:00 heroku[slug-compiler]: Slug compilation failed: failed to compile Ruby app
2016-04-26T11:37:26.534228+00:00 heroku[web.1]: State changed from crashed to starting
2016-04-26T11:37:32.239987+00:00 heroku[web.1]: Starting process with command `bundle exec rails server -p 48566`
2016-04-26T11:37:34.485283+00:00 app[web.1]: bash: bundle: command not found
2016-04-26T11:37:35.145372+00:00 heroku[web.1]: Process exited with status 127
2016-04-26T11:37:35.160181+00:00 heroku[web.1]: State changed from crashed to starting
2016-04-26T11:37:35.157438+00:00 heroku[web.1]: State changed from starting to crashed
2016-04-26T11:37:40.225006+00:00 heroku[web.1]: Starting process with command `bundle exec rails server -p 57613`
2016-04-26T11:37:41.536602+00:00 app[web.1]: bash: bundle: command not found
2016-04-26T11:37:42.254167+00:00 heroku[web.1]: Process exited with status 127
2016-04-26T11:37:42.273228+00:00 heroku[web.1]: State changed from starting to crashed
2016-04-26T11:37:43.433890+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=justarandomname-sandbox.herokuapp.com request_id=4570bf17-d1d5-46f8-a2fa-9b3903e5f7b8 fwd="78.128.33.2" dyno= connect= service= status=503 bytes=
2016-04-26T11:37:43.875014+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=justarandomname-sandbox.herokuapp.com request_id=bef38221-b815-42f0-bff9-a5af6ec9faef fwd="78.128.33.2" dyno= connect= service= status=503 bytes=
2016-04-26T11:37:43.928876+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=justarandomname-sandbox.herokuapp.com request_id=af6d1b23-6fca-4936-831a-8be720931110 fwd="78.128.33.2" dyno= connect= service= status=503 bytes=
2016-04-26T11:38:18.973552+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=justarandomname-sandbox.herokuapp.com request_id=bdcbfa80-b930-458c-9838-22d143092149 fwd="78.128.33.2" dyno= connect= service= status=503 bytes=
2016-04-26T11:38:30.012185+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=justarandomname-sandbox.herokuapp.com request_id=7e6af745-e613-448c-be0e-be6c14c4499e fwd="78.128.33.2" dyno= connect= service= status=503 bytes=
2016-04-26T11:38:31.797207+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=justarandomname-sandbox.herokuapp.com request_id=11006d32-abf4-481e-896e-3da3a9778902 fwd="78.128.33.2" dyno= connect= service= status=503 bytes=
2016-04-26T11:38:33.450964+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=justarandomname-sandbox.herokuapp.com request_id=731c163d-73dc-49d8-9334-96621b9afa99 fwd="78.128.33.2" dyno= connect= service= status=503 bytes=
2016-04-26T11:38:35.451317+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=justarandomname-sandbox.herokuapp.com request_id=1bf2c73c-cd8e-4b4a-a9c2-967934186c3f fwd="78.128.33.2" dyno= connect= service= status=503 bytes=
附加信息
档案:
web: bundle exec rails server -p $PORT
console: bundle exec rails console
Heroku 配置变量:
PATH => bin:vendor/bundle/ruby/2.0.0/bin:qr/qrencode-3.2.0:bin:/.bin:/usr/local/bin:/usr/bin:/bin
GEM_PATH => vendor/bundle/ruby/2.0.0
RACK_ENV => production
RAILS_ENV => production
Heroku 构建包: