【问题标题】:Rails App crashes when deployed to Heroku, not sure what to make of the logs, started when 1.9.1->1.9.3Rails 应用程序在部署到 Heroku 时崩溃,不确定如何处理日志,从 1.9.1->1.9.3 开始
【发布时间】:2012-12-23 01:25:23
【问题描述】:

好吧,我放弃了,需要你的帮助。我的 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=

【问题讨论】:

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


    【解决方案1】:

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

    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)
    

    这表明瘦网络服务器无法以传递的参数启动。基于此: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
    

    现在它可以工作并解决其他问题。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-02-11
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-01-03
      • 2015-10-11
      • 2020-09-24
      相关资源
      最近更新 更多