ruby-on-rails - Webpacker list 为空,样式加载后

标签 ruby-on-rails heroku webpack webpacker

当我尝试从部署在 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') %>

让我感到惊讶的是, list 中似乎有一些东西,但它只是被添加在括号之后。很想看看是否有人可以告诉我这是否是这里的问题以及如何解决它。

最佳答案

复制文件后尝试运行:

bundle exec rake assets:precompile

我用一个空的覆盖了 manifest.json。

关于ruby-on-rails - Webpacker list 为空,样式加载后,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/66936707/

相关文章:

ruby-on-rails - `brew upgrade <package>` : "<package> cannot be built with any available compilers"

ruby-on-rails - 如何在rails中将静态页面的输入保存到数据库

python - 安装自定义构建 heroku 和库路径问题

node.js - 当将具有node_modules的本地Node.js项目Git repo推送到Heroku时,本地node_modules是否会覆盖Heroku上的那些?

php - 在 PHP laravel 框架中使用 webpack 和 react 不能热更新?

ssl - 无法使用自签名证书和 Webpack 开发服务器设置 Service Worker

webpack - 导出未定义 webpack 4

ruby-on-rails - 带有 Uploadify 和 Paper_Clip 的 Rails 3

javascript - 从 python 脚本获取数据时,在 Heroku 上运行的 NodeJS 应用程序失败

ruby-on-rails - Sidekiq卡在空闲模式下(Heroku)