问题描述
当我尝试从部署在 Heroku 上的网站访问页面时,出现错误:
ActionView::Template::Error (Webpacker can't find application.js in /app/public/packs/manifest.json`
这是它向我展示的解决方案:
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:
{
}
):
8: <%= stylesheet_pack_tag "application",media: 'all','data-turbolinks-track': 'reload' %>
9: <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.8.2/css/all.css">
10:
11: <%= javascript_pack_tag 'application','data-turbolinks-track': 'reload' %>
12: <script src="https://js.stripe.com/v3/"></script>
13:
14: <%= favicon_link_tag asset_path('favicon.ico') %>
令我惊讶的是清单中似乎有一些东西,但它只是在括号之后添加。很想看看是否有人能告诉我这是否是这里的问题以及如何解决。
解决方法
复制文件后尝试运行:
bundle exec rake assets:precompile
我正在用一个空的文件覆盖 manifest.json。