konchanxxx / menta

MENTAのタスク管理用リポジトリ
0 stars 0 forks source link

herokuでのエラーについて。 #56

Closed yoshimitsu41 closed 5 years ago

yoshimitsu41 commented 5 years ago

概要

herokuでデプロイしてエラーがでて表示がされません。 出ているエラーは下記です。

$ heroku logs
2019-03-22T01:34:29.475208+00:00 app[web.1]: from config.ru:in `new'
2019-03-22T01:34:29.475212+00:00 app[web.1]: from config.ru:in `<main>'
2019-03-22T01:34:29.475214+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.5.0/gems/rack-2.0.6/lib/rack/builder.rb:49:in `eval'
2019-03-22T01:34:29.475218+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.5.0/gems/rack-2.0.6/lib/rack/builder.rb:49:in `new_from_string'
2019-03-22T01:34:29.475222+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.5.0/gems/rack-2.0.6/lib/rack/builder.rb:40:in `parse_file'
2019-03-22T01:34:29.475225+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.5.0/gems/rack-2.0.6/lib/rack/server.rb:319:in `build_app_and_options_from_config'
2019-03-22T01:34:29.475228+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.5.0/gems/rack-2.0.6/lib/rack/server.rb:219:in `app'
2019-03-22T01:34:29.475232+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.5.0/gems/railties-5.1.6.1/lib/rails/commands/server/server_command.rb:24:in `app'
2019-03-22T01:34:29.475235+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.5.0/gems/rack-2.0.6/lib/rack/server.rb:354:in `wrapped_app'
2019-03-22T01:34:29.475239+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.5.0/gems/rack-2.0.6/lib/rack/server.rb:283:in `start'
2019-03-22T01:34:29.475242+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.5.0/gems/railties-5.1.6.1/lib/rails/commands/server/server_command.rb:44:in `start'
2019-03-22T01:34:29.475280+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.5.0/gems/railties-5.1.6.1/lib/rails/commands/server/server_command.rb:135:in `block in perform'
2019-03-22T01:34:29.475282+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.5.0/gems/railties-5.1.6.1/lib/rails/commands/server/server_command.rb:130:in `tap'
2019-03-22T01:34:29.475283+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.5.0/gems/railties-5.1.6.1/lib/rails/commands/server/server_command.rb:130:in `perform'
2019-03-22T01:34:29.475285+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.5.0/gems/thor-0.20.3/lib/thor/command.rb:27:in `run'
2019-03-22T01:34:29.475287+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.5.0/gems/thor-0.20.3/lib/thor/invocation.rb:126:in `invoke_command'
2019-03-22T01:34:29.475291+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.5.0/gems/thor-0.20.3/lib/thor.rb:387:in `dispatch'
2019-03-22T01:34:29.475293+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.5.0/gems/railties-5.1.6.1/lib/rails/command/base.rb:63:in `perform'
2019-03-22T01:34:29.475295+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.5.0/gems/railties-5.1.6.1/lib/rails/command.rb:44:in `invoke'
2019-03-22T01:34:29.475296+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.5.0/gems/railties-5.1.6.1/lib/rails/commands.rb:16:in `<top (required)>'
2019-03-22T01:34:29.475300+00:00 app[web.1]: from bin/rails:9:in `require'
2019-03-22T01:34:29.475302+00:00 app[web.1]: from bin/rails:9:in `<main>'
2019-03-22T01:34:33.479881+00:00 heroku[web.1]: Starting process with command `bin/rails server -p 15925 -e production`
2019-03-22T01:34:38.699642+00:00 heroku[web.1]: State changed from starting to crashed
2019-03-22T01:34:38.590253+00:00 app[web.1]: => Booting Puma
2019-03-22T01:34:38.590283+00:00 app[web.1]: => Rails 5.1.6.1 application starting in production
2019-03-22T01:34:38.590285+00:00 app[web.1]: => Run `rails server -h` for more startup options
2019-03-22T01:34:38.591056+00:00 app[web.1]: Exiting
2019-03-22T01:34:38.591121+00:00 app[web.1]: /app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.1.6.1/lib/active_support/dependencies.rb:292:in `require': /app/vendor/bundle/ruby/2.5.0/gems/devise-4.3.0/app/controllers/devise/sessions_controller.rb:5: syntax error, unexpected '{', expecting keyword_end (SyntaxError)
2019-03-22T01:34:38.591127+00:00 app[web.1]: ...ion only: [:create, :destroy] { request.env["devise.skip_tim...
2019-03-22T01:34:38.591129+00:00 app[web.1]: ...                              ^
2019-03-22T01:34:38.591136+00:00 app[web.1]: /app/vendor/bundle/ruby/2.5.0/gems/devise-4.3.0/app/controllers/devise/sessions_controller.rb:5: syntax error, unexpected '}', expecting keyword_end
2019-03-22T01:34:38.591138+00:00 app[web.1]: ..."devise.skip_timeout"] = true }
2019-03-22T01:34:38.591140+00:00 app[web.1]: ...                              ^
2019-03-22T01:34:38.591164+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.1.6.1/lib/active_support/dependencies.rb:292:in `block in require'
2019-03-22T01:34:38.591167+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.1.6.1/lib/active_support/dependencies.rb:258:in `load_dependency'
2019-03-22T01:34:38.591168+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.1.6.1/lib/active_support/dependencies.rb:292:in `require'
2019-03-22T01:34:38.591174+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.1.6.1/lib/active_support/dependencies.rb:379:in `block in require_or_load'
2019-03-22T01:34:38.591176+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.1.6.1/lib/active_support/dependencies.rb:36:in `block in load_interlock'
2019-03-22T01:34:38.591180+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.1.6.1/lib/active_support/dependencies/interlock.rb:12:in `block in loading'
2019-03-22T01:34:38.591181+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.1.6.1/lib/active_support/concurrency/share_lock.rb:149:in `exclusive'
2019-03-22T01:34:38.591185+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.1.6.1/lib/active_support/dependencies/interlock.rb:11:in `loading'
2019-03-22T01:34:38.591187+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.1.6.1/lib/active_support/dependencies.rb:36:in `load_interlock'
2019-03-22T01:34:38.591191+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.1.6.1/lib/active_support/dependencies.rb:357:in `require_or_load'
2019-03-22T01:34:38.591193+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.1.6.1/lib/active_support/dependencies.rb:335:in `depend_on'
2019-03-22T01:34:38.591194+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.1.6.1/lib/active_support/dependencies.rb:251:in `require_dependency'
2019-03-22T01:34:38.591198+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.5.0/gems/railties-5.1.6.1/lib/rails/engine.rb:476:in `block (2 levels) in eager_load!'
2019-03-22T01:34:38.591200+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.5.0/gems/railties-5.1.6.1/lib/rails/engine.rb:475:in `each'
2019-03-22T01:34:38.591204+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.5.0/gems/railties-5.1.6.1/lib/rails/engine.rb:475:in `block in eager_load!'
2019-03-22T01:34:38.591206+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.5.0/gems/railties-5.1.6.1/lib/rails/engine.rb:473:in `each'
2019-03-22T01:34:38.591210+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.5.0/gems/railties-5.1.6.1/lib/rails/engine.rb:473:in `eager_load!'
2019-03-22T01:34:38.591212+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.5.0/gems/railties-5.1.6.1/lib/rails/engine.rb:354:in `eager_load!'
2019-03-22T01:34:38.591216+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.5.0/gems/railties-5.1.6.1/lib/rails/application/finisher.rb:67:in `each'
2019-03-22T01:34:38.591217+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.5.0/gems/railties-5.1.6.1/lib/rails/application/finisher.rb:67:in `block in <module:Finisher>'
2019-03-22T01:34:38.591219+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.5.0/gems/railties-5.1.6.1/lib/rails/initializable.rb:30:in `instance_exec'
2019-03-22T01:34:38.591223+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.5.0/gems/railties-5.1.6.1/lib/rails/initializable.rb:30:in `run'
2019-03-22T01:34:38.591225+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.5.0/gems/railties-5.1.6.1/lib/rails/initializable.rb:59:in `block in run_initializers'
2019-03-22T01:34:38.591229+00:00 app[web.1]: from /app/vendor/ruby-2.5.3/lib/ruby/2.5.0/tsort.rb:228:in `block in tsort_each'
2019-03-22T01:34:38.591231+00:00 app[web.1]: from /app/vendor/ruby-2.5.3/lib/ruby/2.5.0/tsort.rb:350:in `block (2 levels) in each_strongly_connected_component'
2019-03-22T01:34:38.591232+00:00 app[web.1]: from /app/vendor/ruby-2.5.3/lib/ruby/2.5.0/tsort.rb:431:in `each_strongly_connected_component_from'
2019-03-22T01:34:38.591236+00:00 app[web.1]: from /app/vendor/ruby-2.5.3/lib/ruby/2.5.0/tsort.rb:349:in `block in each_strongly_connected_component'
2019-03-22T01:34:38.591238+00:00 app[web.1]: from /app/vendor/ruby-2.5.3/lib/ruby/2.5.0/tsort.rb:347:in `each'
2019-03-22T01:34:38.591240+00:00 app[web.1]: from /app/vendor/ruby-2.5.3/lib/ruby/2.5.0/tsort.rb:347:in `call'
2019-03-22T01:34:38.591244+00:00 app[web.1]: from /app/vendor/ruby-2.5.3/lib/ruby/2.5.0/tsort.rb:347:in `each_strongly_connected_component'
2019-03-22T01:34:38.591246+00:00 app[web.1]: from /app/vendor/ruby-2.5.3/lib/ruby/2.5.0/tsort.rb:226:in `tsort_each'
2019-03-22T01:34:38.591247+00:00 app[web.1]: from /app/vendor/ruby-2.5.3/lib/ruby/2.5.0/tsort.rb:205:in `tsort_each'
2019-03-22T01:34:38.591251+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.5.0/gems/railties-5.1.6.1/lib/rails/initializable.rb:58:in `run_initializers'
2019-03-22T01:34:38.591253+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.5.0/gems/railties-5.1.6.1/lib/rails/application.rb:353:in `initialize!'
2019-03-22T01:34:38.591255+00:00 app[web.1]: from /app/config/environment.rb:5:in `<top (required)>'
2019-03-22T01:34:38.591258+00:00 app[web.1]: from config.ru:3:in `require_relative'
2019-03-22T01:34:38.591260+00:00 app[web.1]: from config.ru:3:in `block in <main>'
2019-03-22T01:34:38.591262+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.5.0/gems/rack-2.0.6/lib/rack/builder.rb:55:in `instance_eval'
2019-03-22T01:34:38.591265+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.5.0/gems/rack-2.0.6/lib/rack/builder.rb:55:in `initialize'
2019-03-22T01:34:38.591267+00:00 app[web.1]: from config.ru:in `new'
2019-03-22T01:34:38.591269+00:00 app[web.1]: from config.ru:in `<main>'
2019-03-22T01:34:38.591272+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.5.0/gems/rack-2.0.6/lib/rack/builder.rb:49:in `eval'
2019-03-22T01:34:38.591274+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.5.0/gems/rack-2.0.6/lib/rack/builder.rb:49:in `new_from_string'
2019-03-22T01:34:38.591276+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.5.0/gems/rack-2.0.6/lib/rack/builder.rb:40:in `parse_file'
2019-03-22T01:34:38.591280+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.5.0/gems/rack-2.0.6/lib/rack/server.rb:319:in `build_app_and_options_from_config'
2019-03-22T01:34:38.591282+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.5.0/gems/rack-2.0.6/lib/rack/server.rb:219:in `app'
2019-03-22T01:34:38.591283+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.5.0/gems/railties-5.1.6.1/lib/rails/commands/server/server_command.rb:24:in `app'
2019-03-22T01:34:38.591287+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.5.0/gems/rack-2.0.6/lib/rack/server.rb:354:in `wrapped_app'
2019-03-22T01:34:38.591289+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.5.0/gems/rack-2.0.6/lib/rack/server.rb:283:in `start'
2019-03-22T01:34:38.591290+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.5.0/gems/railties-5.1.6.1/lib/rails/commands/server/server_command.rb:44:in `start'
2019-03-22T01:34:38.591294+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.5.0/gems/railties-5.1.6.1/lib/rails/commands/server/server_command.rb:135:in `block in perform'
2019-03-22T01:34:38.591295+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.5.0/gems/railties-5.1.6.1/lib/rails/commands/server/server_command.rb:130:in `tap'
2019-03-22T01:34:38.591297+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.5.0/gems/railties-5.1.6.1/lib/rails/commands/server/server_command.rb:130:in `perform'
2019-03-22T01:34:38.591301+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.5.0/gems/thor-0.20.3/lib/thor/command.rb:27:in `run'
2019-03-22T01:34:38.591302+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.5.0/gems/thor-0.20.3/lib/thor/invocation.rb:126:in `invoke_command'
2019-03-22T01:34:38.591306+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.5.0/gems/thor-0.20.3/lib/thor.rb:387:in `dispatch'
2019-03-22T01:34:38.591308+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.5.0/gems/railties-5.1.6.1/lib/rails/command/base.rb:63:in `perform'
2019-03-22T01:34:38.591367+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.5.0/gems/railties-5.1.6.1/lib/rails/command.rb:44:in `invoke'
2019-03-22T01:34:38.591370+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.5.0/gems/railties-5.1.6.1/lib/rails/commands.rb:16:in `<top (required)>'
2019-03-22T01:34:38.591371+00:00 app[web.1]: from bin/rails:9:in `require'
2019-03-22T01:34:38.591373+00:00 app[web.1]: from bin/rails:9:in `<main>'
2019-03-22T01:34:38.675128+00:00 heroku[web.1]: Process exited with status 1
2019-03-22T01:34:40.112675+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=greenhill-db.herokuapp.com request_id=b9f65447-b471-41c2-834d-b7d691178d84 fwd="60.145.9.164" dyno= connect= service= status=503 bytes= protocol=https
2019-03-22T01:34:42.760461+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=greenhill-db.herokuapp.com request_id=324981cc-ec9f-4fe0-8a47-cc3e40eab8ef fwd="60.145.9.164" dyno= connect= service= status=503 bytes= protocol=https
2019-03-22T01:41:35.855609+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=greenhill-db.herokuapp.com request_id=83e73cb9-d497-41ff-bcb7-6721ada57c43 fwd="60.145.9.164" dyno= connect= service= status=503 bytes= protocol=https
2019-03-22T01:41:36.821473+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=greenhill-db.herokuapp.com request_id=69f77179-a4e4-450c-bb67-29aa02423a91 fwd="60.145.9.164" dyno= connect= service= status=503 bytes= protocol=https

何が問題でエラーになっているのでしょうか? また、エラーを見るコツなどがあればご教授お願いします。

問題となっているアプリケーションのGitHub URL

https://github.com/yoshimitsu41/greenhill.git

konchanxxx commented 5 years ago
2019-03-22T01:34:38.591121+00:00 app[web.1]: /app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.1.6.1/lib/active_support/dependencies.rb:292:in `require': /app/vendor/bundle/ruby/2.5.0/gems/devise-4.3.0/app/controllers/devise/sessions_controller.rb:5: syntax error, unexpected '{', expecting keyword_end (SyntaxError)

って出てるんでそのファイルに原因がありそうですが見れたりしますかね??

konchanxxx commented 5 years ago

また、エラーを見るコツなどがあればご教授お願いします。

基本的にはErrorとかFailとか書かれているところがあるのでそこのファイルの行を確認しておかしなところがないかまずは確認する感じですね。 それでも分からなければError,Failって書いているところのエラー原因っぽいやつを検索してみるとかでしょうか。あとはGemが原因とかならそのgemのリポジトリを確認してissueをみるとかソースコードを読み込むとかですね:smile:

yoshimitsu41 commented 5 years ago

調べてみたとろこrubyのバージョンとdeviseのバージョンの問題っぽいです。 現在ローカルではruby 2.3.1を使っていました。 deviseは4.3.0。

herokuのrubyのバージョンを調べると2.5.3でした。 ruby2.5とdevise4.3がうまく動かないようでした。 https://github.com/plataformatec/devise/issues/4630

gemfileを gem 'devise', git: 'https://github.com/plataformatec/devise' として再度デプロイすると問題なく動きました! ありがとうございます。

konchanxxx commented 5 years ago

おお、解決したようで良かったです! そもそもは開発環境と本番環境でバージョン差異があってはいけないので開発時のRubyのバージョンを固定するなどしておいたほうが良いと思います。 rbenvなど使えばできるのでやって見てください:smile: https://qiita.com/ex_SOUL/items/bcaf214294f530f0b054

konchanxxx commented 5 years ago

@yoshimitsu41