Rails 6.1 no longer listens to -e param for runner
The readme specifies that the default definition of "runner" is
job_type :runner, "cd :path && bin/rails runner -e :environment ':task' :output"
It seems that Rails 6.1 (possibly Rails 6?) no longer supports defining the environment with the -e pram. As a result the runner would execute in the development environtment which caused a bunch of errors on production obviously. To fix, I needed to append "RAILS_ENV=production" to the bundle command in schedule.rb.
set :bundle_command, "RAILS_ENV=#{ENV["RAILS_ENV"]} bundle exec"
This fixed the issue but wondering if anyone else is seeing this issue and whether something needs to be fixed in the gem itself.
I just hit this issue in Rails 6.1. Thanks for the workaround. I think this is a valid bug report.
Rails documentation (https://guides.rubyonrails.org/command_line.html#bin-rails-runner) says -e is still valid, and it worked locally for me. Good to know, so I'll keep an eye out for it on production.