2

正如 Bamboo to Cedar 迁移指南所述,我将其添加Procfile到我的 Heroku 应用程序中:

web: bundle exec unicorn -p $PORT -E $RACK_ENV -c config/unicorn.rb
worker: bundle exec rake jobs:work

然后我跑过去bundle install推。现在服务器不再启动:

heroku[web.1]: State changed from up to starting
app[web.1]:     /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/webrick/server.rb:170:in `block in start'
app[web.1]:     /app/vendor/bundle/ruby/2.0.0/gems/railties-3.0.19/lib/rails/commands/server.rb:65:in `start'
app[web.1]:     /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/webrick/server.rb:32:in `start'
app[web.1]:     /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/webrick/server.rb:160:in `start'
app[web.1]:     /app/vendor/bundle/ruby/2.0.0/gems/rack-1.2.8/lib/rack/server.rb:217:in `start'
app[web.1]: [2014-07-17 04:02:16] FATAL SignalException: SIGTERM
app[web.1]:     /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/webrick/server.rb:170:in `select'
app[web.1]:     /app/vendor/bundle/ruby/2.0.0/gems/railties-3.0.19/lib/rails/commands.rb:30:in `block in <top (required)>'
app[web.1]: [2014-07-17 04:02:16] INFO  WEBrick::HTTPServer#start done.
app[web.1]:     /app/vendor/bundle/ruby/2.0.0/gems/railties-3.0.19/lib/rails/commands.rb:27:in `tap'
app[web.1]: [2014-07-17 04:02:16] INFO  going to shutdown ...
app[web.1]: Exiting
app[web.1]:     /app/vendor/bundle/ruby/2.0.0/gems/rack-1.2.8/lib/rack/handler/webrick.rb:13:in `run'
app[web.1]:     script/rails:6:in `require'
app[web.1]:     /app/vendor/bundle/ruby/2.0.0/gems/railties-3.0.19/lib/rails/commands.rb:27:in `<top (required)>'
app[web.1]:     script/rails:6:in `<main>'
app[web.1]: bundler: command not found: unicorn
app[web.1]: Install missing gem executables with `bundle install`

我究竟做错了什么?

4

1 回答 1

7

添加gem 'unicorn'到您的 Gemfile,运行bundle install. 提交更新的 Gemfile 和 Gemfile.lock 文件并将其推送到 Heroku。

于 2014-07-17T07:26:03.877 回答