#... require 'whenever/capistrano' #... set :whenever_command, "bundle exec whenever" set :bundle_flags, "--deployment --quiet --binstubs" set :default_environment, { 'PATH' => "$HOME/.rbenv/shims:$HOME/.rbenv/bin:$PATH" } #... namespace :rbenv do task :rehash do run 'rbenv rehash' end end task :backup do run "cd #{current_path} && bundle exec rake backup RAILS_ENV=#{rails_env}" end #... after "bundle:install", "rbenv:rehash"