前提・実現したいこと
Ruby on railsでHerokuにアプリケーションをデプロイして初期画面を表示させたいです。
発生している問題
初期画面のhttps://butube.herokuapp.com/にアクセスするとしたの画面が表示されてしまう。
エラーメッセージ
heroku logs --tail
とするとログが出力されます。
2020-06-04T08:59:47.581168+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.6.0/gems/railties- 省略 2020-06-04T08:59:47.581313+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.6.0/gems/rack-2.2.2/lib/rack/builder.rb:116:in `new_from_string' 2020-06-04T08:59:47.581316+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.6.0/gems/rack-2.2.2/lib/rack/builder.rb:105:in `load_file' 2020-06-04T08:59:47.581336+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.6.0/gems/rack-2.2.2/lib/rack/builder.rb:66:in `parse_file' 2020-06-04T08:59:47.581337+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.6.0/gems/rack-2.2.2/lib/rack/server.rb:349:in `build_app_and_options_from_config' 2020-06-04T08:59:47.581343+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.6.0/gems/rack-2.2.2/lib/rack/server.rb:249:in `app' 2020-06-04T08:59:47.581345+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.6.0/gems/rack-2.2.2/lib/rack/server.rb:422:in `wrapped_app' 2020-06-04T08:59:47.581364+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.6.0/gems/rack-2.2.2/lib/rack/server.rb:312:in `block in start' 2020-06-04T08:59:47.581365+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.6.0/gems/rack-2.2.2/lib/rack/server.rb:379:in `handle_profiling' /app/vendor/bundle/ruby/2.6.0/gems/thor-1.0.1/lib/thor/command.rb:27:in `run' 2020-06-04T08:59:47.581415+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.6.0/gems/thor-1.0.1/lib/thor/invocation.rb:127:in `invoke_command' 2020-06-04T08:59:47.667499+00:00 heroku[web.1]: State changed from crashed to starting 2020-06-04T09:00:04.131661+00:00 app[web.1]: DEPRECATION WARNING: Including LoggerSilence is deprecated and will be removed in Rails 6.1. Please use `ActiveSupport::LoggerSilence` instead (called from <top (required)> at /app/config/application.rb:3) 2020-06-04T09:00:04.213157+00:00 app[web.1]: => Booting Puma 2020-06-04T09:00:04.213160+00:00 app[web.1]: => Rails 6.0.3.1 application starting in production 2020-06-04T09:00:04.213160+00:00 app[web.1]: => Run `rails server --help` for more startup options 2020-06-04T09:00:06.496369+00:00 app[web.1]: Exiting 2020-06-04T09:00:06.496674+00:00 app[web.1]: /app/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.2/lib/i18n/backend/base.rb:227:in `load_file': can not load translations from /app/config/locales/en.yml: expects it to return a hash, but does not (I18n::InvalidLocaleData) 2020-06-04T09:00:06.496701+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.2/lib/i18n/backend/base.rb:18:in `block in load_translations' 2020-06-04T09:00:06.496702+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.2/lib/i18n/backend/base.rb:18:in `each' 2020-06-04T09:00:06.496705+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.2/lib/i18n/backend/base.rb:18:in `load_translations' 2020-06-04T09:00:06.496706+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.2/lib/i18n/backend/simple.rb:80:in `init_translations' 2020-06-04T09:00:06.496708+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.2/lib/i18n/backend/simple.rb:65:in `eager_load!' 2020-06-04T09:00:06.496729+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.6.0/gems/i18n-1.8.2/lib/i18n.rb:76:in `eager_load!' 2020-06-04T09:00:06.496730+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.6.0/gems/railties-6.0.3.1/lib/rails/application/finisher.rb:123:in `each' 2020-06-04T09:00:06.496734+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.6.0/gems/railties-6.0.3.1/lib/rails/application/finisher.rb:123:in `block in <module:Finisher>' 2020-06-04T09:00:06.496737+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.6.0/gems/railties-6.0.3.1/lib/rails/initializable.rb:32:in `instance_exec' 2020-06-04T09:00:06.496758+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.6.0/gems/railties-6.0.3.1/lib/rails/initializable.rb:32:in `run' 2020-06-04T09:00:06.496758+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.6.0/gems/railties-6.0.3.1/lib/rails/initializable.rb:61:in `block in run_initializers' 2020-06-04T09:00:06.496761+00:00 app[web.1]: from /app/vendor/ruby-2.6.6/lib/ruby/2.6.0/tsort.rb:228:in `block in tsort_each' 2020-06-04T09:00:06.496764+00:00 app[web.1]: from /app/vendor/ruby-2.6.6/lib/ruby/2.6.0/tsort.rb:350:in `block (2 levels) in each_strongly_connected_component' 2020-06-04T09:00:06.496793+00:00 app[web.1]: from /app/vendor/ruby-2.6.6/lib/ruby/2.6.0/tsort.rb:431:in `each_strongly_connected_component_from' 2020-06-04T09:00:06.496794+00:00 app[web.1]: from /app/vendor/ruby-2.6.6/lib/ruby/2.6.0/tsort.rb:349:in `block in each_strongly_connected_component' 2020-06-04T09:00:06.496799+00:00 app[web.1]: from /app/vendor/ruby-2.6.6/lib/ruby/2.6.0/tsort.rb:347:in `each' 2020-06-04T09:00:06.496799+00:00 app[web.1]: from /app/vendor/ruby-2.6.6/lib/ruby/2.6.0/tsort.rb:347:in `call' 2020-06-04T09:00:06.496802+00:00 app[web.1]: from /app/vendor/ruby-2.6.6/lib/ruby/2.6.0/tsort.rb:347:in `each_strongly_connected_component' 2020-06-04T09:00:06.496805+00:00 app[web.1]: from /app/vendor/ruby-2.6.6/lib/ruby/2.6.0/tsort.rb:226:in `tsort_each' 2020-06-04T09:00:06.496832+00:00 app[web.1]: from /app/vendor/ruby-2.6.6/lib/ruby/2.6.0/tsort.rb:205:in `tsort_each' 2020-06-04T09:00:06.496833+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.6.0/gems/railties-6.0.3.1/lib/rails/initializable.rb:60:in `run_initializers' 2020-06-04T09:00:06.496837+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.6.0/gems/railties-6.0.3.1/lib/rails/application.rb:363:in `initialize!' 2020-06-04T09:00:06.496855+00:00 app[web.1]: from /app/config/environment.rb:2:in `<top (required)>' 2020-06-04T09:00:06.496859+00:00 app[web.1]: from config.ru:1:in `require_relative' 2020-06-04T09:00:06.496860+00:00 app[web.1]: from config.ru:1:in `block in <main>' 2020-06-04T09:00:06.496860+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.6.0/gems/rack-2.2.2/lib/rack/builder.rb:116:in `eval' 2020-06-04T09:00:06.496861+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.6.0/gems/rack-2.2.2/lib/rack/builder.rb:116:in `new_from_string' 2020-06-04T09:00:06.496861+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.6.0/gems/rack-2.2.2/lib/rack/builder.rb:105:in `load_file' 2020-06-04T09:00:06.496864+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.6.0/gems/rack-2.2.2/lib/rack/builder.rb:66:in `parse_file' 2020-06-04T09:00:06.496864+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.6.0/gems/rack-2.2.2/lib/rack/server.rb:349:in `build_app_and_options_from_config' 2020-06-04T09:00:06.496895+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.6.0/gems/rack-2.2.2/lib/rack/server.rb:249:in `app' 2020-06-04T09:00:06.496895+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.6.0/gems/rack-2.2.2/lib/rack/server.rb:422:in `wrapped_app' 2020-06-04T09:00:06.496899+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.6.0/gems/rack-2.2.2/lib/rack/server.rb:312:in `block in start' 2020-06-04T09:00:06.496900+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.6.0/gems/rack-2.2.2/lib/rack/server.rb:379:in `handle_profiling' 2020-06-04T09:00:06.496902+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.6.0/gems/rack-2.2.2/lib/rack/server.rb:311:in `start' 2020-06-04T09:00:06.496931+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.6.0/gems/railties-6.0.3.1/lib/rails/commands/server/server_command.rb:39:in `start' 2020-06-04T09:00:06.496932+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.6.0/gems/railties-6.0.3.1/lib/rails/commands/server/server_command.rb:147:in `block in perform' 2020-06-04T09:00:06.496935+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.6.0/gems/railties-6.0.3.1/lib/rails/commands/server/server_command.rb:138:in `tap' 省略 2020-06-04T09:00:09.918944+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=butube.herokuapp.com request_id=5342f61d-fcdf-46fb-a029-efbe12ab96dc fwd="133.201.148.96" dyno= connect= service= status=503 bytes= protocol=https
おそらく下のコードがエラーの原因だと思います。
DEPRECATION WARNING: Including LoggerSilence is deprecated and will be removed in Rails 6.1. Please use `ActiveSupport::LoggerSilence` instead (called from <top (required)> at /app/config/application.rb:3)
おそらく
「LoggerSilenceの代わりにActiveSupport::LoggerSilenceを使いましょう」のようなことを伝えてくれているのだと思います。
どのようにすれば↑の指示に従えるのかわかりません。
一応調べて下のようにしましたがどうすればいいのかがいまいちわかりませんので良ければ教えていただきたいです!
application_controller.rb
class MyLogger < Logger include LoggerSilence include ActiveSupport::LoggerThreadSafeLevel end
config/environment/development.rb
config/environment/production.rb
config/environment/test.rb
上の3つのファイルに
error_logger = ActiveSupport::Logger.new(STDOUT) error_logger.level = Logger::ERROR Rails.logger.extend ActiveSupport::Logger.broadcast(error_logger)
を追記しましたがうまくいきません。
補足情報
Windows 10 home 64ビット
ruby 2.6.6
Ruby on rails 6.0.3.1
PostgreSQL 13beta1
テキストエディタ Atom
失礼な点があるかもしれませんがどうぞ宜しくおねがい致します。
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。