Browse files

tell capistrano to run "bundle exec rake"

closes #894
  • Loading branch information...
1 parent 36f1594 commit e0ec73bb32f3a276b7424105250d4ccb57d222e9 @indirect indirect committed Jan 19, 2011
Showing with 1 addition and 0 deletions.
  1. +1 −0 lib/bundler/capistrano.rb
1 lib/bundler/capistrano.rb
@@ -7,4 +7,5 @@
Capistrano::Configuration.instance(:must_exist).load do
after "deploy:update_code", "bundle:install"
Bundler::Deployment.define_task(self, :task, :except => { :no_release => true })
+ set :rake, 'bundle exec rake'
m4n Feb 4, 2011

Shouldn't this be set :rake, "#{bundle_cmd} exec rake"?

cgriego Feb 5, 2011

m4n: Good point, but simply doing interpolating bundle_cmd means it will likely evaluate before someone has set the bundle_cmd configuration. It will need to be lazily evaluated, like so:

set :rake, lambda { "#{fetch(:bundle_cmd, "bundle")} exec rake" }

It should also honor the bundle_gemfile config option, but bundle exec doesn't support the --gemfile option (reference) so it would need to be set as an environment variable. Capistrano executes each command within a unique shell so it would have to be done as a part of the same command, which is hard to do reliably since there's no guarantee on how the rake setting will be used in all recipes.

indirect Apr 8, 2011 Bundler member

Made that change in 34585e4, at least. It's true that there's no guarantees, but that should at least help out the more straightforward usages.


0 comments on commit e0ec73b

Please sign in to comment.