-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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
Don't fallback to RACK_ENV when RAILS_ENV is not present #19404
Conversation
Good catch. So this is only working right now, because for development |
Agree with @dmathieu. It's not a valid fallback option. |
Don't fallback to RACK_ENV when RAILS_ENV is not present
@dmathieu can you add a Changelog entry for that? |
@arthurnn: sure, will do. |
Agreed 👍, maybe for another PR we should investigate a better way to integrate both things. |
Considering this was intentionally, thoroughly, and publicly supported, we should go through a deprecation cycle to remove it. |
After looking into the history, 👎 entirely. There's a long history of using |
@jeremy do as you wish. I just want to mention that it makes IE very slow on some versions of AWS's ELB, which can be a big issue for anyone. |
was there any consideration falling back to APP_ENV ? |
RACK_ENV
is not the same asRAILS_ENV
, and can't serve as a fallback when the later isn't present.See http://www.hezmatt.org/~mpalmer/blog/2013/10/13/rack_env-its-not-for-you.html
In fact, it can even cause some issues if your app is using unicorn, as they're including internal rack middlewares relying on
RACK_ENV
to have thedeployment
value.See https://github.com/defunkt/unicorn/blob/master/lib/unicorn.rb#L56-L79
Rack itself does that too.
https://github.com/rack/rack/blob/4e4ab39b0508aa3e59f5d7e53696ef6ae7c220ed/lib/rack/server.rb#L228
This removes support for falling back to RACK_ENV when RAILS_ENV is not available.