Question

I've suddenly started getting slug size errors on deploy:

-----> Compiled slug size: 350.4MB is too large (max is 300MB).

My app is far too small to be causing this, verified by manually inspecting bundle and assets size. Upon investigation in a one-off dyno, I discovered that files installed by the R buildpack are still in vendor/ even though I stopped using the buildpack months ago and unset BUILDPACK_URL:

~/vendor $ du -h --max-depth 1
90M ./ruby-2.0.0
28K ./plugins
24K ./heroku
122M    ./bundle
113M    ./glibc-2.7
16M ./bin
95M ./gcc-4.3
36M ./ruby-1.9.3
104K    ./assets
87M ./R
1.2M    ./gems
450M    ./libexec
108K    ./redis-rb
1008M   .  

Deleting them in a one-off dyno doesn't do it; they reappear in a new one.

How can I make these directories, like R/ and gcc-4.3/ permanently go away?

Was it helpful?

Solution

It is possible that the R buildpack placed these files into your build's cache dir and then the Ruby buildpack is still pulling those in. It is unlikely that the two buildpacks would conflict that way, but is possible. I would recommend trying to push your code to a brand new app and see if your slug size drops. If so, you can use the third-party/unsupported heroku-repo plugin to purge your build cache on the original app.

OTHER TIPS

Delete the directories from your source code. In fact, you should be able to delete most everything under /vendor from your source code, and rely on the Heroku packages.

UPDATE0 From the README.md on the R buildpack github page:

Caveats

Due to the size of the R runtime, the slug size on Heroku, without any additional packages or program code, is approximately 45Mb.

Where is your other 310MB coming from?

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top