2

I am using whenever and seed_dump gem. I am getting the following error while running whenever --update-crontab.

config/schedule.rb:11:in `block in initialize': uninitialized constant Whenever::JobList::RAILS_ROOT (NameError)

my schedule.rb file.

every 48.hours do
  command "rm #{RAILS_ROOT}/db/seeds.rb"
  rake "db:seed:dump"
end

What does the error says? What should I do? Thanks in advance.

poombavai
  • 111
  • 11

1 Answers1

1

The gem whenever does not require or depend on Rails, thus there is no such constant.

Add the following to the top of the schedule.rb to fix the issue:

RAILS_ROOT = File.expand_path(File.dirname(__FILE__) + '/')
Andrey Deineko
  • 51,333
  • 10
  • 112
  • 145