Question

We've got a fairly large app that's going up on heroku... It's an app using browsercms as the base, and it's built on top of that. The Gemfile isn't that big (we don't have more gems than our average app) but for some reason, deploying takes 15 minutes. Compiling and pushing assets to s3 (via assetsync) takes about 5 minutes due to all the assets, but the remaining 10 minutes is spent during this:

----> Heroku receiving push   
-----> Removing .DS_Store files
-----> Ruby/Rails app detected
-----> Using Ruby version: ruby-1.9.3
-----> Installing dependencies using Bundler version 1.2.0
       Running: bundle install --without development:test --path vendor/bundle --binstubs bin/ --deployment

Anyone have any clue why this part takes so long? The gemfile lock is in the repo, and pushed to heroku, and here's a gist of our gemfile: https://gist.github.com/aa44bbb06eed97736c20

EDIT: We're on rails 3.2.7

Was it helpful?

Solution

When bundler uses a gem that has a git repo it will download the entire git repo in order to include the gem, not just the master branch or whatever branch is the main branch.

We had this same issue with the rails_admin gem by sferik.

It might help if you specify a specific branch like so:

gem "browsercms", "3.5.3", git: 'git://github.com/josiahivey/browsercms.git', :branch => 'master'

One way to tell is to look at the compiled slug size before and after you make a change. In our case, rails_admin was responsible for about 30mb of our slug size. Heroku has a 100mb slug size limit too, just FYI.

You may also try running the bundle pack command like this:

bundle pack --all

This will put all your gems (supposedly the git ones too, because of the --all switch) into your vendor/cache directory.

As indicated in this github isssue for the bundler project (look at the end, where a heroku guy responds):

https://github.com/carlhuda/bundler/issues/67

OTHER TIPS

Two things sped up this process. Bundler 1.2.1 seemed to help, and turbo sprockets saved a good couple minutes. It's tolerable now.

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