Skip to content

Remove setting RAILS_ENV from RACK_ENV, NODE_ENV defaults RAILS_ENV #3239

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

Merged
merged 2 commits into from
Dec 3, 2021

Conversation

justin808
Copy link
Contributor

@justin808 justin808 commented Nov 28, 2021

Per https://nodejs.dev/learn/nodejs-the-difference-between-development-and-production

Generally, the only value that matters for NODE_ENV is production.

Given the old code, I suspect that many people ran rake assets:precompile and had the NODE_ENV incorrectly set to 'development' for production builds.

Actually, for running the rake task to build, https://github.com/rails/webpacker/blob/master/lib/tasks/webpacker/compile.rake#L23 sets the NODE_ENV to production if not set.

@justin808 justin808 added this to the 6.0 milestone Nov 28, 2021
@justin808 justin808 changed the title Remove setting RAILS_ENV from RACK_ENV Remove setting RAILS_ENV from RACK_ENV, NODE_ENV defaults RAILS_ENV Nov 28, 2021
@guillaumebriday
Copy link
Member

This is great, maybe we should talk about RACK_ENV removal in the upgrade docs?

@guillaumebriday guillaumebriday merged commit 79718d9 into rails:master Dec 3, 2021
@justin808 justin808 deleted the remove-rack-env branch December 3, 2021 22:24
@justin808
Copy link
Contributor Author

This is great, maybe we should talk about RACK_ENV removal in the upgrade docs?

@guillaumebriday where in the docs?

justin808 added a commit to justin808/rails that referenced this pull request Jan 6, 2022
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

Successfully merging this pull request may close these issues.

binstubs should NOT honor the RACK_ENV environment variable in addition to the RAILS_ENV environment variable
2 participants