Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

heroku deploy taking very long

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

like image 794
courtsimas Avatar asked Sep 15 '12 19:09

courtsimas


1 Answers

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

like image 170
jakeonrails Avatar answered Sep 19 '22 18:09

jakeonrails