Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I manage bundled gems in a capistrano deployment?

Currently, I'm just running the following:

after 'deploy:update_code', 'deploy:bundle'

namespace :deploy do
  task :bundle do
    run "cd #{release_path} && bundle install --deployment --without development test staging"
  end
end

Now this works fine, but the bundler ends up installing all the gems to vendor/gems every time. While I understand the merit in isolating the gems to each release (as opposed to using the shared folder, which (?) might result in errors on rollback and such), surely there is a better way to do this that doesn't take as much time to deploy and saves on disk space.

like image 561
Steven Avatar asked Jan 20 '23 15:01

Steven


1 Answers

Things have changed after the release of bundler 1.0

You don't need to create a custom task from deploy.

just use require 'bundler/capistrano'

take a look at this http://blog.josephholsten.com/2010/09/deploying-with-bundler-and-capistrano/ for more details

like image 70
Rishav Rastogi Avatar answered Jan 29 '23 19:01

Rishav Rastogi