Skip to content

Instantly share code, notes, and snippets.

@mateomurphy
Created July 28, 2010 03:46
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mateomurphy/493313 to your computer and use it in GitHub Desktop.
Save mateomurphy/493313 to your computer and use it in GitHub Desktop.
namespace :bundler do
task :create_symlink, :roles => :app do
shared_dir = File.join(shared_path, 'bundled_gems')
release_dir = File.join(current_release, 'vendor', 'bundle')
run("mkdir -p #{shared_dir} && ln -s #{shared_dir} #{release_dir}")
end
task :bundle_new_release, :roles => :app do
bundler.create_symlink
run "cd #{release_path} && bundle install --deployment"
end
end
after "deploy:update_code" do
bundler.bundle_new_release
end
@rhulse
Copy link

rhulse commented Aug 2, 2010

You need to change --disable-shared-gems to --production if you have bunder.rc2

@mateomurphy
Copy link
Author

thanks, just updated it

@bouchard
Copy link

bouchard commented Aug 5, 2010

Now, apparently to --deployment rather than --production.

@mateomurphy
Copy link
Author

Updated for rc2

@rhulse
Copy link

rhulse commented Aug 10, 2010

rc 4 now has this built in.

Just add "require 'bundler/capistrano'" in your Capistrano deploy file (deploy.rb).

http://github.com/carlhuda/bundler/blob/master/lib/bundler/capistrano.rb

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment