33

Whenever I'm deploying to Heroku (Ruby on Rails app using the heroku_san gem) it says the following:

Cleaning up the bundler cache.
Would have removed sitemap_generator (2.0.1.pre1)
Would have removed newrelic_rpm (3.5.5.38)
Would have removed httparty (0.10.0)
Would have removed thor (0.16.0)
Would have removed ckeditor (3.7.1)
Would have removed fog (1.8.0)
Would have removed rake (0.9.2.2)
Would have removed dalli (2.6.0)

(or any other old gem I might have from previous deployments) How can I clean the bundler cache in the Heroku app? I tried to run:

heroku run bundle clean --force

but it did not help.

Can anyone tell me how to clean the bundler cache in Heroku? Or if I should ignore this message?

2
  • 2
    What does your heroku_san config, in config/heroku.yml, look like? Jan 29, 2013 at 10:41
  • 1
    It looks like this production: app: 'my app name' stack: cedar config: BUNDLE_WITHOUT: "development:test" S3_BUCKET: "my bucket name" S3_KEY: "my s3 key" S3_SECRET: "my s3 secret"
    – Rubinsh
    Feb 1, 2013 at 5:55

2 Answers 2

22

This is due to a recently-introduced change in Bundler. We (Heroku) need to track down why it thinks it is running in --dry-run mode and fix it.

In the meantime, this is not harmful and shouldn't cause any issues. Unfortunately, there's no way to clear your cache manually if you're worried about it.

3
  • I think that I know the reason for that:stackoverflow.com/questions/14539894/…
    – Roman
    Feb 15, 2013 at 9:03
  • 2
    @Roman We have a hunch now - we think it's a bug in bundler from running bundle exec rake assets:precompile --dry-run being applied to the bundle configuration file. bundle clean is run before this, but the --dry-run config persists between builds.
    – wuputah
    Feb 20, 2013 at 2:02
  • 2
    This issue has now been fixed with the use of Bundler 1.3.2.
    – wuputah
    Mar 12, 2013 at 4:22
5

I also get this on every Heroku app I've ever deployed and have yet to experience problems.

Here's why I think you don't have to worry about it:

  • Having a bunch of stored gems on their server shouldn't slow down your app. Heck, even if you threw in a bunch of gems you didn't need into your Gemfile, the noticeable performance hits are likely to be to your app's initial launch time and subsequent memory use. And if those gems aren't in your Gemfile, the performance hit to your app should be nil.
  • While Heroku has a soft limit of 100MB for slugs on a free account, my own anecdotal evidence suggests that this does not include gems you've removed from your Gemfile (which makes sense if the wild speculation below is correct).

And here's wild speculation as to why Heroku isn't cleaning the bundler cache:

Memory is more expensive than hard drive space, so while most gems might take up a trivial amount of space on a hard drive, they can add up if a ton of gems have to be loaded into memory. However, if a gem isn't in your Gemfile, it won't be in memory. And it's very likely more expensive to remove (and possibly later re-download) a gem than it is to keep it stored on the drive, just in case you later change your mind and want to re-add it to your Gemfile.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.