简体   繁体   English

Rails :: Capistrano :: sh:每当:未找到

[英]Rails :: Capistrano :: sh: whenever: not found

I am trying to deploy a project that uses whenever. 我正在尝试部署一个随时使用的项目。

But getting: 但是得到:

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 ...

Gemfile 宝石文件

gem 'whenever', :require => false

deploy.rb deploy.rb

require "bundler/capistrano"
require 'capistrano/ext/multistage'
require "whenever/capistrano"
require "delayed/recipes"
........

Where is the problem? 问题出在哪儿?

I think you have to use "bundle exec" here. 我认为您必须在此处使用“ bundle exec”。

set :whenever_command, "bundle exec whenever"
require "whenever/capistrano"

This is mentioned in the official documentation :) https://github.com/javan/whenever 官方文档中提到了这一点:) https://github.com/javan/whenever

You will have to require 'whenever' explicitly because of your :required => false in the Gemfile. 由于Gemfile中的:required => false ,您将必须明确要求“ whenever”。 The bundler will not require it automatically when you have :required => false . 当您具有:required => false时,捆绑程序将不会自动要求它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM