ruby-on-rails - 从1.9.1-> 1.9.3开始,将Rails App部署到Heroku时崩溃,不确定由什么组成的日志

标签 ruby-on-rails ruby-on-rails-3 heroku crash ruby-on-rails-3.2

好的,我放弃了,需要您的帮助。 My Rails应用程序在Heroku上崩溃并曾经在1.9.3之前运行。我已经完成了1.9.3的所有更改,甚至创建了一个新应用程序,但它始终会崩溃。在本地工作正常。以下是heroku日志中的内容:

2013-01-09T03:00:59+00:00 heroku[web.1]: Starting process with command `bundle exec rails server thin -p 52530
2013-01-09T03:01:04+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/tlsmail-0.0.1/lib/net/pop.rb:689: warning: already initialized constant POP3Session
2013-01-09T03:01:04+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/tlsmail-0.0.1/lib/net/pop.rb:702: warning: already initialized constant APOPSession
2013-01-09T03:01:04+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/tlsmail-0.0.1/lib/net/smtp.rb:806: warning: already initialized constant SMTPSession
2013-01-09T03:01:04+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/tlsmail-0.0.1/lib/net/pop.rb:687: warning: already initialized constant POP
2013-01-09T03:01:04+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/tlsmail-0.0.1/lib/net/pop.rb:688: warning: already initialized constant POPSession
2013-01-09T03:01:08+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/rack-1.3.8/lib/rack/server.rb:283:in `parse_options'
2013-01-09T03:01:08+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/railties-3.1.10/lib/rails/commands/server.rb:33:in `parse!' (OptionParser::InvalidArgument)
2013-01-09T03:01:08+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/rack-1.3.8/lib/rack/server.rb:180:in `options'
2013-01-09T03:01:08+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.1.10/lib/rails/commands.rb:54:in `block in <top (required)>'
2013-01-09T03:01:08+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.1.10/lib/rails/commands.rb:49:in `<top (required)>'
2013-01-09T03:01:08+00:00 app[web.1]:   from script/rails:6:in `require'
2013-01-09T03:01:08+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.1.10/lib/rails/commands/server.rb:58:in `start'
2013-01-09T03:01:08+00:00 app[web.1]:   from script/rails:6:in `<main>'
2013-01-09T03:01:08+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.1.10/lib/rails/commands.rb:49:in `tap'
2013-01-09T03:01:08+00:00 app[web.1]: Exiting
2013-01-09T03:01:09+00:00 heroku[web.1]: Process exited with status 1
2013-01-09T03:01:09+00:00 heroku[web.1]: State changed from starting to crashed
2013-01-09T03:01:11+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path=/ host=xxxxxx.herokuapp.com fwd=xxx.xxx.xxx.xxx dyno= queue= wait= connect= service= status=503 bytes=

最佳答案

好吧,我已经解决了。日志中的线索是:

2013-01-09T03:01:08+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/railties-3.1.10/lib/rails/commands/server.rb:33:in `parse!' (OptionParser::InvalidArgument)

这表明瘦Web服务器无法从传递的参数开始。基于以下内容:https://devcenter.heroku.com/articles/rails3,我将procfile从以下位置更改:
web: bundle exec rails server thin -p $PORT

对此:
web: bundle exec rails server thin -p $PORT -e $RACK_ENV

并使用以下命令将RACK_ENV设置为在我的环境中暂存:
$ echo "RACK_ENV=development" >>.env

现在,它可以解决其他问题。

关于ruby-on-rails - 从1.9.1-> 1.9.3开始,将Rails App部署到Heroku时崩溃,不确定由什么组成的日志,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14227748/

相关文章:

ruby-on-rails - Ruby - 生成逗号分隔数组的数组

ruby-on-rails - 如何在 Rails 中优化这段代码?

ruby-on-rails-3 - Rails 3.2 - 使用远程 MySQL 数据库的 Heroku 部署

javascript - 如何使用 PhantomJs 从网页中截取 googlemap 的屏幕截图?

ruby-on-rails - 如何使用 Rails Clockwork gem 运行 rake 任务?

ruby-on-rails - 如何使用 Heroku 和 Cloudfront 为 Rails 激活页面缓存?

ruby-on-rails - Rails 5.2 credentials.yaml.enc 和 master.key 不适用于 Heroku

ruby-on-rails - 如何测试 (ActiveRecord) 对象是否相等

ruby-on-rails - 如何在 ubuntu 上卸载 Ruby?

ruby-on-rails-3 - Carrierwave + s3 + 雾 (Excon::Errors::SocketError)