Rails 5.2.0 requires RAILS_MASTER_KEY
Rails 5.2.0 introduced encrypted credentials http://weblog.rubyonrails.org/2018/3/20/Rails-5-2-RC2/
If one wants to use it, then it has to set RAILS_MASTER_KEY environment variable (there is also a way with static file, but I guess env variable is a recommended one).
The problem with cron and whenever is that by default this env is not set, thus launching rails app will fail with error ActiveSupport::EncryptedFile::MissingKeyError: Missing encryption key to decrypt file with. Ask your team for your master key and write it to config/master.key or put it in the ENV['RAILS_MASTER_KEY'].
To fix it, it's enough to write in schedule.rb: env :RAILS_MASTER_KEY, ENV["RAILS_MASTER_KEY"]
I'm wondering if whenever should do it out of the box, as it is already having some Rails related code,
I guess it would go here https://github.com/javan/whenever/blob/master/lib/whenever/setup.rb#L7
If not, maybe some addition to Readme would be good so people are aware?
Your suggestion would result in the master key being written to the crontab, which I don’t think is desirable. The default job template launches a login shell. Maybe it is better to suggest placing the master key either in the suggested file or in the user’s shell environment.
This has tripped me up in docker, when adapting your user profile ~is too much work~ exceeds my capabilites 😉
I think it would be worth noting this exactly in the README, or in the Wiki's troubleshooting section!
This is still a problem for me, does anyone has an elegant solution?