環境
- ruby:2.6.3p62 (2019-04-16 revision 67580) [x86_64-linux]
- rails:6.0.3
解決したいこと
rails tutorisl5章の終わりでherokuにデプロイするところで詰まっています。
herokuにデプロイはされているのですが、いざ開いてみると「We're sorry, but something went wrong.」と表示されます。
現状
git push heroku
development.log
development.log
1Started GET "/" for 60.64.7.197 at 2021-10-09 01:36:55 +0000 2Cannot render console from 60.64.7.197! Allowed networks: 127.0.0.0/127.255.255.255, ::1 3 [1m[35m (4.6ms)[0m [1m[34mSELECT sqlite_version(*)[0m 4Processing by ApplicationController#hello as HTML 5 Rendering html template 6 Rendered html template (Duration: 0.0ms | Allocations: 5) 7Completed 200 OK in 11ms (Views: 6.8ms | ActiveRecord: 0.0ms | Allocations: 1809) 8 9Started GET "/" for 60.64.7.197 at 2021-10-09 01:36:56 +0000 10Cannot render console from 60.64.7.197! Allowed networks: 127.0.0.0/127.255.255.255, ::1 11Processing by ApplicationController#hello as HTML 12 Rendering html template 13 Rendered html template (Duration: 0.0ms | Allocations: 3) 14Completed 200 OK in 2ms (Views: 1.6ms | ActiveRecord: 0.0ms | Allocations: 292) 15 16Started GET "/" for 60.64.7.197 at 2021-10-09 01:46:56 +0000 17Cannot render console from 60.64.7.197! Allowed networks: 127.0.0.0/127.255.255.255, ::1 18 [1m[35m (0.1ms)[0m [1m[34mSELECT sqlite_version(*)[0m 19Processing by ApplicationController#hello as HTML 20 Rendering html template 21 Rendered html template (Duration: 0.0ms | Allocations: 3) 22Completed 200 OK in 3ms (Views: 2.1ms | ActiveRecord: 0.0ms | Allocations: 451) 23 24Started GET "/static_pages/home" for 60.64.7.197 at 2021-10-09 01:48:10 +0000 25Cannot render console from 60.64.7.197! Allowed networks: 127.0.0.0/127.255.255.255, ::1 26Processing by StaticPagesController#home as HTML 27 Rendering static_pages/home.html.erb within layouts/application 28 Rendered static_pages/home.html.erb within layouts/application (Duration: 1.5ms | Allocations: 365) 29[Webpacker] Compiling… 30[Webpacker] Compiled all packs in /home/ubuntu/environment/tweet2/public/packs 31[Webpacker] warning ../../package.json: No license field 32One CLI for webpack must be installed. These are recommended choices, delivered as separate packages: 33 - webpack-cli (https://github.com/webpack/webpack-cli) 34 The original webpack full-featured CLI. 35We will use "yarn" to install the CLI via "yarn add -D". 36Do you want to install 'webpack-cli' (yes/no): 37[Webpacker] 38Completed 500 Internal Server Error in 1540ms (ActiveRecord: 0.0ms | Allocations: 714993)
heroku logs -t
2021-10-13T12:51:20.000000+00:00 app[api]: Build started by user ~@gmail.com 2021-10-13T12:52:06.196176+00:00 app[api]: Deploy 2fa80624 by user ~@gmail.com 2021-10-13T12:52:06.196176+00:00 app[api]: Release v22 created by user ~@gmail.com 2021-10-13T12:52:08.912008+00:00 heroku[web.1]: State changed from down to starting 2021-10-13T12:52:13.262848+00:00 heroku[web.1]: Starting process with command `bundle exec puma -C config/puma.rb` 2021-10-13T12:52:14.370997+00:00 app[web.1]: Puma starting in single mode... 2021-10-13T12:52:14.371036+00:00 app[web.1]: * Version 4.3.6 (ruby 2.7.4-p191), codename: Mysterious Traveller 2021-10-13T12:52:14.371037+00:00 app[web.1]: * Min threads: 5, max threads: 5 2021-10-13T12:52:14.371037+00:00 app[web.1]: * Environment: production 2021-10-13T12:52:15.000000+00:00 app[api]: Build succeeded 2021-10-13T12:52:17.121584+00:00 app[web.1]: * Listening on tcp://0.0.0.0:18528 2021-10-13T12:52:17.121821+00:00 app[web.1]: Use Ctrl-C to stop 2021-10-13T12:52:17.190858+00:00 heroku[web.1]: State changed from starting to up 2021-10-13T12:52:19.996257+00:00 app[web.1]: I, [2021-10-13T12:52:19.996156 #4] INFO -- : [b7dba1f4-0c8e-408b-80eb-3f302a024518] Started GET "/" for 60.64.7.197 at 2021-10-13 12:52:19 +0000 2021-10-13T12:52:19.999126+00:00 app[web.1]: I, [2021-10-13T12:52:19.999043 #4] INFO -- : [b7dba1f4-0c8e-408b-80eb-3f302a024518] Processing by StaticPagesController#home as HTML 2021-10-13T12:52:20.009011+00:00 app[web.1]: I, [2021-10-13T12:52:20.008931 #4] INFO -- : [b7dba1f4-0c8e-408b-80eb-3f302a024518] Rendering static_pages/home.html.erb within layouts/application 2021-10-13T12:52:20.010211+00:00 app[web.1]: I, [2021-10-13T12:52:20.010140 #4] INFO -- : [b7dba1f4-0c8e-408b-80eb-3f302a024518] Rendered static_pages/home.html.erb within layouts/application (Duration: 1.0ms | Allocations: 284) 2021-10-13T12:52:20.013181+00:00 app[web.1]: I, [2021-10-13T12:52:20.013128 #4] INFO -- : [b7dba1f4-0c8e-408b-80eb-3f302a024518] Completed 500 Internal Server Error in 13ms (Allocations: 2347) 2021-10-13T12:52:20.013882+00:00 heroku[router]: at=info method=GET path="/" host= ~.herokuapp.com request_id=b7dba1f4-0c8e-408b-80eb-3f302a024518 fwd="60.64.7.197" dyno=web.1 connect=0ms service=20ms status=500 bytes=1827 protocol=https 2021-10-13T12:52:20.014340+00:00 app[web.1]: F, [2021-10-13T12:52:20.014259 #4] FATAL -- : [b7dba1f4-0c8e-408b-80eb-3f302a024518] 2021-10-13T12:52:20.014341+00:00 app[web.1]: [b7dba1f4-0c8e-408b-80eb-3f302a024518] ActionView::Template::Error (Webpacker can't find application in /app/public/packs/manifest.json. Possible causes: 2021-10-13T12:52:20.014342+00:00 app[web.1]: 1. You want to set webpacker.yml value of compile to true for your environment 2021-10-13T12:52:20.014342+00:00 app[web.1]: unless you are using the `webpack -w` or the webpack-dev-server. 2021-10-13T12:52:20.014343+00:00 app[web.1]: 2. webpack has not yet re-run to reflect updates. 2021-10-13T12:52:20.014343+00:00 app[web.1]: 3. You have misconfigured Webpacker's config/webpacker.yml file. 2021-10-13T12:52:20.014344+00:00 app[web.1]: 4. Your webpack configuration is not creating a manifest. 2021-10-13T12:52:20.014345+00:00 app[web.1]: Your manifest contains: 2021-10-13T12:52:20.014345+00:00 app[web.1]: { 2021-10-13T12:52:20.014345+00:00 app[web.1]: } 2021-10-13T12:52:20.014346+00:00 app[web.1]: ): 2021-10-13T12:52:20.014346+00:00 app[web.1]: [b7dba1f4-0c8e-408b-80eb-3f302a024518] 6: <%= csp_meta_tag %> 2021-10-13T12:52:20.014346+00:00 app[web.1]: [b7dba1f4-0c8e-408b-80eb-3f302a024518] 7: <%= stylesheet_link_tag 'application', media: 'all', 2021-10-13T12:52:20.014351+00:00 app[web.1]: [b7dba1f4-0c8e-408b-80eb-3f302a024518] 8: 'data-turbolinks-track': 'reload' %> 2021-10-13T12:52:20.014352+00:00 app[web.1]: [b7dba1f4-0c8e-408b-80eb-3f302a024518] 9 <%= javascript_pack_tag 'application', 2021-10-13T12:52:20.014352+00:00 app[web.1]: [b7dba1f4-0c8e-408b-80eb-3f302a024518] 10: 'data-turbolinks-track': 'reload' %> 2021-10-13T12:52:20.014352+00:00 app[web.1]: [b7dba1f4-0c8e-408b-80eb-3f302a024518] 11: <%= render 'layouts/shim' %> 2021-10-13T12:52:20.014352+00:00 app[web.1]: [b7dba1f4-0c8e-408b-80eb-3f302a024518] 12: </head> 2021-10-13T12:52:20.014353+00:00 app[web.1]: [b7dba1f4-0c8e-408b-80eb-3f302a024518] 2021-10-13T12:52:20.014353+00:00 app[web.1]: [b7dba1f4-0c8e-408b-80eb-3f302a024518] app/views/layouts/application.html.erb:9 2021-10-13T12:52:20.303090+00:00 heroku[router]: at=info method=GET path="/favicon.ico" host=~.herokuapp.com request_id=3f37830e-7988-425b-a4b2-e39ed7862d70 fwd="60.64.7.197" dyno=web.1 connect=0ms service=5ms status=200 bytes=143 protocol=https
試したこと
- この前にもherokuにpushしたときに、以下のメッセージがあったので
yarn add webpack-cli -D
を実行しましたが、今回もこのメッセージが表示されました。
One CLI for webpack must be installed. These are recommended choices, delivered as separate packages:
(省略) Do you want to install 'webpack-cli' (yes/no):
- 似たような状況に遭遇した方々の記事などを参考に、
$ heroku run rails db:migrate
を実行しましたが結果は変わりませんでした。