Muntasim
Muntasim

Reputation: 6786

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

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

Where is the problem?

Upvotes: 1

Views: 1376

Answers (2)

untidyhair
untidyhair

Reputation: 3642

I think you have to use "bundle exec" here.

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

This is mentioned in the official documentation :) https://github.com/javan/whenever

Upvotes: 5

usha
usha

Reputation: 29349

You will have to require 'whenever' explicitly because of your :required => false in the Gemfile. The bundler will not require it automatically when you have :required => false.

Upvotes: 0

Related Questions