Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Heroku - Build fail "LoadError: canot load such file -- coffee_script"

As the title states, I'm unable to complete a build on Heroku after removing gem 'coffee-rails' from my Gemfile.

Below is the error message as well as a few lines before that show that it is removing coffee-script.

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'

To me, it looks like this could be an issue with Bootsnap on Heroku.

Steps I've taken:

  1. Removed gem 'coffee-rails' Ran bundle update .
  2. Removed all references to coffee script per this answer
  3. Added, committed and pushed the updated Gemfile and Gemfile.lock to my master branch.
  4. Ran rake tmp:cache:clear on Heroku via bash.
  5. Restarted dyno

At this point, I'm tempted to just keep the gem installed as I've confirmed that the build passes.

Any assistance would be wonderful.

Edit: I have staging app setup that had this same issue. Simply starting a new staging app/remote solved the issue, so that's why I'm leaning towards a cache issue.

like image 208
troxwalt Avatar asked Jan 02 '19 20:01

troxwalt


1 Answers

Had the exact same issue. As you have mentioned, the cache needs clearing. To do this

heroku repo:purge_cache
git push heroku master

If you don't have heroku repo, it's a plugin that needs to be installed. Just follow those steps mentioned in Heroku's guide here:

heroku plugins:install heroku-repo
heroku repo:purge_cache -a appname
git commit --allow-empty -m "Purge cache"
git push heroku master

Should work fine now Note heroku repo:purge_cache without the app's name is of course enough if the remote is setup.

like image 134
mrateb Avatar answered Sep 27 '22 16:09

mrateb