环境
Rails 6.0.0
Ruby 2.6.0
Amazon Linux2什么

当我部署我的rails应用程序时,发生以下错误
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.1.除非您使用的是webpack -w或webpack-dev- webpacker.yml,否则您希望根据您的环境将compile的服务器值设置为true。
我的config/webpacker.yml包含
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: true2. webpack尚未重新运行以反映更新。
我跑步
$ RAILS_ENV=production bundle exec rails webpacker:compile3.错误配置了Webpacker的config/webpacker.yml文件。
在开发环境中,webpacker可以正常工作。
4.您的webpack配置没有创建清单。
manifest.json创建完成
发布于 2019-12-17 17:02:49
我在运行预构建的Rails6 app.Found时遇到了同样的问题,那是因为yarn.lock文件中的Webpack版本不一致。然后当我跑的时候
yarn add @rails/webpacker
bundle update webpacker
正如在此comment中发现的,问题已解决。
发布于 2021-09-22 03:05:46
我也有同样的问题。只需在开发环境中运行:
rails webpacker:install如果您使用Docker,请运行:
docker exec rails-app-name rails webpacker:install发布于 2021-11-21 22:09:00
如果您的文件系统中不存在manifest.json,请使用rake assets:precompile创建它。
https://stackoverflow.com/questions/58520418
复制相似问题