Witam!
Mam problem z Whenever oraz Cronem na serwerze produkcyjnym.
Apke wysyłam poprzez Capistriano. Na serwerze używam RVM.
Whenever genreuję mi CRON-a który zwraca
bundler: command not found: script/runner
# frozen_string_literal: true
env :PATH, ENV['PATH']
env :GEM_PATH, ENV['GEM_PATH']
set :output, '/home/deploy/cron.log'
every 1.day, at: ['9:55 pm'] do
runner 'ReminderService.new.perform'
end
Cron na serwerze wyglada tak:
# Begin Whenever generated tasks for: invoice_organizer_production at: 2019-01-16 21:58:21 +0100
PATH=/home/deploy/invoice_organizer/shared/bundle/ruby/2.5.0/bin:/home/deploy/.rvm/gems/ruby-2.5.3/bin:/home/deploy/.rvm/gems/ruby-2.5.3@global/bin:/home/deploy/.rvm/rubies/ruby-2.5.3/bin:/home/deploy/.rvm/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games
GEM_PATH=""
58 21 * * * /bin/bash -l -c 'cd /home/deploy/invoice_organizer/releases/20190116205456 && bundle exec script/runner -e production '\''ReminderService.new.perform'\'' >> /home/deploy/cron.log 2>&1'
# End Whenever generated tasks for: invoice_organizer_production at: 2019-01-16 21:55:21 +0100
Odpalenie z CLI niestety przynosi ten sam error
Capistriano 3.11
Whenever 0.10.0
W deploy.rb mam też linie
set :whenever_identifier, -> { "#{fetch(:application)}_#{fetch(:stage)}" }
Capfile zawiera
require 'capistrano/deploy'
require 'capistrano/bundler'
require 'capistrano/rvm'
require 'capistrano/rails/assets' # for asset handling add
require 'capistrano/rails/migrations' # for running migrations
require 'capistrano/puma'
require 'whenever/capistrano'