capistrano support: rake variable not updated to use bundle exec #894

gabetax opened this Issue Dec 7, 2010 · 2 comments

2 participants


Following the capistrano documentation on, the "rake" command is not updated to be called via bundle exec. The result is that commands using rake, such as deploy:migrate, can encounter loading conflicts:

$ cap deploy:migrate
  * executing `deploy:migrate'
  * executing "ls -x /webapps/rails/"
    servers: [""]
    [] executing command
    command finished
latest => /webapps/rails/
  * executing "cd /webapps/rails/; rake RAILS_ENV=production  db:migrate"
    servers: [""]
    [] executing command
*** [err ::] rake aborted!
*** [err ::] You have already activated rake 0.8.4, but your Gemfile requires rake 0.8.7. Consider using bundle exec.
*** [err ::] /webapps/rails/
*** [err ::] (See full trace by running task with --trace)
 ** [out ::] (in /webapps/rails/
    command finished
failed: "sh -c 'cd /webapps/rails/; rake RAILS_ENV=production  db:migrate'" on

(on this specific example, I'm deploying a Rails 2.3.10 app; I haven't tested a Rails 3 app)

An easy solution is to override the default rake variable in the config/deploy.rb file:
set :rake, 'bundle exec rake'

I think the documentation on should be updated to reflect this, or the bundler/capistrano.rb file should make some effort to over-ride this itself.

Bundler member

Yeah, that seems like a good idea. Thanks!

Bundler member

tell capistrano to run "bundle exec rake"

closed by e0ec73b

@leobessa leobessa pushed a commit that referenced this issue Apr 18, 2011
@indirect indirect tell capistrano to run "bundle exec rake"
closes #894
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment