如何解决Dokku 部署失败,升级后的 Rails 6.0 应用程序
我一直在将 Rails 5.2 应用程序升级到 Rails 6。我还没有安装 Webpack,但在 Dokku(它具有与 Heroku 类似的构建系统)上出现以下部署错误:
webpack binstubs not found.
Have you run rails webpacker:install ?
Make sure the bin directory or binstubs are not included in .gitignore
Exiting!
!
! Precompiling assets failed.
!
This is similar error but from a new project and had different answer
解决方法
如果您正在使用 Dokku(也许是 Heroku?),请在准备好迁移到 Webpacker 之前添加 Webpacker gem。
Rails 6 默认将 Webpacker 引入 Gemfile 中,我在升级过程中不假思索地复制了它。我已经添加了 Gem,但我还没有从 Sprockets 迁移到在 Webpacks 中使用 Javascript(Rails 6 中的默认设置)。
在部署过程中,Dokku 在 gemfile 中看到了 Webpacker gem,并期望 Webpacker 已经安装,但实际上并没有 - 导致错误。
从 Gemfile 中删除 Webpacker 解决了这个问题,直到我准备好查看 Webpacker。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。