Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rails 6.1 no longer listens to -e param for runner #810

Open
ishields opened this issue Jan 11, 2021 · 2 comments
Open

Rails 6.1 no longer listens to -e param for runner #810

ishields opened this issue Jan 11, 2021 · 2 comments

Comments

@ishields
Copy link

ishields commented Jan 11, 2021

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.

@atomgiant
Copy link

I just hit this issue in Rails 6.1. Thanks for the workaround. I think this is a valid bug report.

@timirwin
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants