エラーになった過程
vueをrails6に導入して、vuetifyを追加。→試しにvuetifyのパーツをコピペ。→うまく機能しているかブラウザで確かめるため、rails s→コンパイル時にエラー発生。
#エラー内容
ActionView::Template::Error (Webpacker can't find hello_vue in /usr/src/myapp/public/packs/manifest.json. Possible causes:
1. You want to set webpacker.yml value of compile to true for your environment
unless you are using the `webpack -w` or the webpack-dev-server.
2. webpack has not yet re-run to reflect updates.
3. You have misconfigured Webpacker's config/webpacker.yml file.
4. Your webpack configuration is not creating a manifest.
Your manifest contains:
{
"application.js": "/packs/js/application-9afcbb5693aa87623e69.js",
"application.js.map": "/packs/js/application-9afcbb5693aa87623e69.js.map",
"components/user.js": "/packs/js/components/user-156f569cb5c8b04ee2e1.js",
"components/user.js.map": "/packs/js/components/user-156f569cb5c8b04ee2e1.js.map",
"entrypoints": {
"application": {
"js": [
"/packs/js/application-9afcbb5693aa87623e69.js"
],
"js.map": [
"/packs/js/application-9afcbb5693aa87623e69.js.map"
]
},
"components/user": {
"js": [
"/packs/js/components/user-156f569cb5c8b04ee2e1.js"
],
"js.map": [
"/packs/js/components/user-156f569cb5c8b04ee2e1.js.map"
]
},
"main": {
"js": [
"/packs/js/main-f6918c73db91592ebf7f.js"
],
"js.map": [
"/packs/js/main-f6918c73db91592ebf7f.js.map"
]
}
},
"main.js": "/packs/js/main-f6918c73db91592ebf7f.js",
"main.js.map": "/packs/js/main-f6918c73db91592ebf7f.js.map"
}
):
11:
12: <body>
13: <%= yield %>
14: <%= javascript_pack_tag 'hello_vue' %>
15: </body>
16: </html>
app/views/layouts/application.html.erb:14
^C- Gracefully stopping, waiting for requests to finish
=== puma shutdown: 2020-11-12 02:56:13 +0000 ===
- Goodbye!
ここにも書いてあるが、→https://github.com/rails/webpacker#vue
下のコマンドを上から実行していくと、エラーが解決しました。
./bin/rails webpacker:install
./bin/rails webpacker:install:vue
bin/webpack