【发布时间】:2019-05-29 11:37:00
【问题描述】:
正如标题所述,从我的 Gemfile 中删除 gem 'coffee-rails' 后,我无法在 Heroku 上完成构建。
以下是错误消息以及之前的几行表明它正在删除咖啡脚本。
remote: Removing coffee-script (2.4.1)
remote: Removing coffee-script-source (1.12.2)
remote: Removing coffee-rails (4.2.2)
remote: The latest bundler is 2.0.0.pre.3, but you are currently running 1.15.2.
remote: To update, run `gem install bundler --pre`
remote: -----> Installing node-v8.10.0-linux-x64
remote: -----> Detecting rake tasks
remote: -----> Preparing app for Rails asset pipeline
remote: Running: rake assets:precompile
remote: Yarn executable was not detected in the system.
remote: Download Yarn at https://yarnpkg.com/en/docs/install
remote: rake aborted!
remote: LoadError: cannot load such file -- coffee_script
remote: /tmp/build_dc46e31874491817c9a77e17cf3ac4d1/vendor/bundle/ruby/2.4.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
在我看来,这可能是 Heroku 上的 Bootsnap 的问题。
我已采取的步骤:
- 删除
gem 'coffee-rails'然bundle update。 - 删除了所有对咖啡脚本的引用answer
- 已将更新的 Gemfile 和 Gemfile.lock 添加、提交并推送到我的主分支。
- 通过 bash 在 Heroku 上运行
rake tmp:cache:clear。 - 重新启动测功机
此时,我很想继续安装 gem,因为我已经确认构建通过了。
任何帮助都会很棒。
编辑:我有暂存应用程序设置有同样的问题。只需启动一个新的暂存应用程序/远程即可解决问题,这就是我倾向于缓存问题的原因。
【问题讨论】:
-
尝试删除
tmp/cache/bootsnap-compile-cache和tmp/cache/bootsnap-load-path-cache -
@Tom 谢谢 - 我确实删除了这些,但它们会在 dyno 重新启动时重新创建。
-
试试
heroku repo:purge_cache -
我收到
repo:purge_cache is not a heroku command -
最后也重新安装了 gem :(
标签: ruby-on-rails heroku assets