Rails :: Capistrano :: sh:无论何时:找不到

Mun*_*sim 1 capistrano ruby-on-rails whenever whenever-capistrano

我正在尝试部署一个随时使用的项目.

但得到:

sh: whenever: not found
rolling back
executing "rm -rf /var/www/rails_apps/portal/releases/20130627122943; true"

failed: "sh -c 'cd /var/www/rails_apps/portal/releases/20130627122943 && whenever --update-crontab iconnect_portal --set environment=production --roles db'" on ...
Run Code Online (Sandbox Code Playgroud)

的Gemfile

gem 'whenever', :require => false
Run Code Online (Sandbox Code Playgroud)

deploy.rb

require "bundler/capistrano"
require 'capistrano/ext/multistage'
require "whenever/capistrano"
require "delayed/recipes"
........
Run Code Online (Sandbox Code Playgroud)

问题出在哪儿?

unt*_*air 5

我想你必须在这里使用"bundle exec".

set :whenever_command, "bundle exec whenever"
require "whenever/capistrano"
Run Code Online (Sandbox Code Playgroud)

这在官方文档中提到:) https://github.com/javan/whenever