1

わかりました、私はあきらめて、あなたの助けが必要です. 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=
4

1 に答える 1

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)

これは、シン 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

これで動作し、他の問題に進みます。

于 2013-01-09T17:34:15.710 に答える