Rails 6.1 no longer listens to -e param for runner
Nobody has claimed this yet.
- Dominant language
- Ruby
- Stars
- 8.9k
- Forks
- 715
- PR merge metrics
- No merged PRs in 30d
Description
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.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the README's default runner definition and the schedule.rb bundle_command workaround. Reproduce the Rails 6.1 behavior to check whether the -e environment is still passed through, then verify that runner jobs use the intended environment without requiring the workaround.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rails, ruby
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100