rails sができない (webpackエラー)
rails sをしても立ち上がらない
環境
Ruby on Rails 6
発生している問題・エラー
Webpacker can't find application in /Users/hoge/RubyApp/hoge/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.html.erb
<%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track': 'reload' %>
<%= javascript_pack_tag 'application', 'data-turbolinks-track': 'reload' %>
</head>
<body>
該当するソースコード
<%= javascript_pack_tag 'application', 'data-turbolinks-track': 'reload' %>
自分で試したこと
このようなエラーが出ている方がいらっしゃったのでググって実行したのですがうまく行きません。
・rails webpacker:install を実行
Webpacker successfully installed 🎉 🍰が出たのでインストールされている
・rails webpacker:compileを実行
warning ../../package.json: No license field
Compiling...
Compilation failed:
yarn run v1.22.17
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
warning ../../package.json: No license field
warning ../../package.json: No license field
error Command "webpack" not found.
うーんコンパイルされてないのがわかる。
・nodeのバージョンがあってないと記載してあったので、brew install node@14を実行したのですが変わらず
該当のエラーコードをコメントアウトしたら動くのですが、Link_toメソッドが使えなくなるのでコメントアウトしたくないです。
宜しくお願い致します。
0 likes