What is slug?
Slugs are compressed and pre-packaged copies of your application optimized for distribution to thedyno manager. When you
git push to Heroku, your code is received by the slug compiler which transforms your repository into a slug. Scaling an application then downloads and expands the slug to a dyno for execution.
What is this error about?
It means you code base is huge and compressing it should not exceed size 300 MB;
How to solve?
If your repository contains files not necessary to run your app, you may wish to add these to a
.slugignore file in the root of your repository. Examples of files you may wish to exclude from the slug:
- Unit tests or specs
- Art sources (like .psd files)
- Design documents (like .pdf files)
- Test data
The format is roughly the same as
.gitignore. Here’s an example
*.psd *.pdf /test /spec
.slugignore file causes files to be removed after you push code to Heroku and before thebuildpack runs. This lets you prevent large files from being included in the final slug. Unlike
.slugignore does not support negated
If Still not fixed:
this worked for me
$ heroku repo:gc -a appname
Will run git gc –aggressive on your repo.
$ heroku repo:purge_cache -a appname
Then I mannually pushed code to heroku
$ git push heroku-prod master
Mainly copied from