Heroku Slugsize shot up drastically

Hi,

Locally my application is 7MB without tests and logs, etc. The .git
folder is 29 MB. I also have no gems / plugins in vendor folder. 95%
of images sit on S3. However on committing to Heroku it shows ----->
Compiled slug size is 62.7MB

What is wrong? It happened?

To add more context my .gitignore file is .bundle, db/.sqlite3, config/
database.yml, log/.log, tmp/, .idea, .redcar, .sass-cache/,
multi_xml/, test/, doc/

Please advice

Make sure that you include a .slugignore file (similar to .gitignore,
but
for heroku) and that you do not include development and test gems (this
is
automatic on cedar, on the other stacks you need to add this manually).

Thank you Martin,

My GemFile puts all dev gems within Dev section
group :development do
gem ‘silent-postgres’
gem ‘hirb’
gem ‘wirble’
gem ‘crack’
gem ‘ap’
end

About Slugignore, I gitignored all items which are to be slugignored.
Does it not solve the problem?

Plus there are no plugins/gems in my vendor folder, the total size of
my app in local directory without .git is 7MB.

You need to make sure that bundle (on heroku) does not include the
development and test gems.
run “heroku config” and look for a BUNDLE_WITHOUT line that should
contain
development:test

If not then execute the following command:

heroku config:add BUNDLE_WITHOUT=“development:test”

slugignore is useful to exclude assets like psd’s that live in your git
but
should not be part of slug. Also some of the less common gems count to
your
slug size even if they are not in your vendor directory. If you include
gems
through :git => they also automatically add to your slug size.

To give you a ballpark figure: My sites have a slugsize of about 50 to
60
meg on cedar on average.

If you run on cedar make sure you do not include therubyracer gem but
instead use the built in node.js (see here for details:
http://devcenter.heroku.com/articles/rails31_heroku_cedar)

Thanks a lot Martin. Only Aspen stack has preinstalled gems. (http://
installed-gems.heroku.com/) Bamboo and Cedar dont. Hence my slug is
high. I need to reduce my gems.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs