Rails 6.0.0
Ruby 2.6.0
Amazon Linux2
When I deploy my rails app this error happen
ActionView::Template::Error (Webpacker can't find application in /home/web/www/eloop-regular/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.
webpack -w
or the webpack-dev-server.my config/webpacker.yml contains
production:
<<: *default
# Production depends on precompilation of packs prior to booting for performance.
compile: true
# Extract and emit a css file
extract_css: true
# Cache manifest.json for performance
cache_manifest: true
I run
$ RAILS_ENV=production bundle exec rails webpacker:compile
in development environment webpacker works correctly.
manifest.json is created
I have the same issue when I run pre-built rails 6 app.Found out it is because of Webpack version inconsistency in yarn.lock file. Then when I run
yarn add @rails/webpacker
bundle update webpacker
as found in this comment , issue's solved.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With