On my development VM and on the server, running whenever command $ bundle exec whenever is not working. I get back the following:
$ bundle exec whenever
bundler: failed to load command: whenever (/home/cgarndt/.rbenv/versions/3.0.0/bin/whenever)
config/schedule.rb:35:in `initialize': uninitialized constant #<Class:#<Whenever::JobList:0x0000555d07619838>>::Rails (NameError)
from /home/cgarndt/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/whenever-1.0.0/lib/whenever/job_list.rb:25:in `instance_eval'
... ... ...
On my development machine I am running:
- Ubuntu 22.04 LTS
- rbenv
- Ruby 3.0
- Rails 7.0.4
- whenever (1.0.0)
I have ran $ bundle exec wheneverize . which ran successfully and created schedule.rb file.
Any help would be appreciated.
Thank you
Chris
Update. My schedule.rb file:
# Need the below for Cron to pick up rbenv user version within Unix-user/application.
# Vs w/o the below line then Cron uses rbenv system version.
env :PATH, ENV['PATH']
# Compare Person API CALS People data to CALS-2 People data
if Rails.env.staging?
every :monday, at: '7:50am' do
runner "CjComparePersApiCalsPeople::Start.execute"
end
end
if ::Rails.env.production?
every :monday, at: '8:05am' do
runner "CjComparePersApiCalsPeople::Start.execute"
end
end