5

A rails 3.0.x project I am working with uses a gem that contains a large amount of test data that isn't needed for the heroku deployment. I would like to exclude this from the heroku slug, as it adds a few dozen megs to the slug (and has pushed us past the 100mb size limit several times, our slug is large for other reasons.)

I've tried doing this using the .slugignore mechanism, but I can't find a way to have it exclude files in gems as opposed to files in the app. This is a rails 3.0.x application running on the bamboo stack, but I would upgrade to rails 3.1 and/or the cedar stack if there was a workaround / procedure in those versions.

Other suggestions about fixing this that aren't 'make the huge gem smaller' are also great and extremely welcome.

corprew
  • 1,991
  • 14
  • 17

2 Answers2

0

In general use case this will not work because .slugignore matched files are being deleted before installing gem files. See the following bit of heroku deployment output:

-----> Deleting 2 files matching .slugignore patterns.
-----> Ruby/Rails app detected
-----> Installing dependencies using Bundler version 1.3.0.pre.5
       Running: bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin --deployment
       Using rake (10.0.3)
       Using Platform (0.4.0)
       Using open4 (1.3.0)
       ...
Tadas Sasnauskas
  • 2,183
  • 1
  • 22
  • 24
0

On cedar stack the gems are installed into your vendor folder (the actual path is something like vendor/bundle/ruby/1.9.1/gems/), so I believe you can slugignore the subpaths you need, though I haven't tried it.

khustochka
  • 2,346
  • 20
  • 29
  • that didn't work. .slugignore doesn't appear to be recursive. too bad .. there's lots of unnecessary stuff in the gems which aren't needed in slug. – dsaronin Dec 31 '11 at 01:21