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

Ruby apps should set APP_ENV #34

Closed
stefansundin opened this issue Jan 17, 2020 · 3 comments
Closed

Ruby apps should set APP_ENV #34

stefansundin opened this issue Jan 17, 2020 · 3 comments

Comments

@stefansundin
Copy link

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Tell us about your request
The Ruby community has decided that RACK_ENV and RAILS_ENV are complicated to use (and used incorrectly a lot). So they decided to add APP_ENV, the one variable to rule them all.

Elastic Beanstalk is setting RACK_ENV=production as a default for new Ruby apps. It should start setting APP_ENV=production as well.

Is this request specific to an Elastic Beanstalk platform?
Ruby

Tell us about the problem you're trying to solve. What are you trying to do, and why is it hard?
It's not hard to set new variables, but better defaults would make things easier for newbies.

Are you currently working around this issue?
I set APP_ENV=production manually after creating an app.

Additional context

In addition, RACK_ENV=production is not an intended value (as seen in the rack code linked above). It has always been intended to be set to either development, deployment, or none. Unfortunately, Heroku and other websites have been telling Ruby developers to set RACK_ENV and RAILS_ENV to the same value, so this mistake is very common. For APP_ENV, they allow production and other values.

I think the default RACK_ENV value should be changed to deployment. This may have some backwards compatibility concerns, but it is the proper value. One way to deal with this is to also start setting RAILS_ENV=production which should fix this concern for Rails developers.

I also think it would be nice if there was a better way to set default environment variables through .ebextensions somehow. Something like Heroku lets you do via an app.json file (example).

Thanks!

@labisso
Copy link
Contributor

labisso commented Jan 24, 2020

Thanks for the suggestion @stefansundin! I think we can do this with fewer backwards-compatibility concerns in our upcoming AL2-based Ruby platform. Changing it in our existing platform needs some more research though.

@labisso labisso changed the title [request]: Ruby apps should set APP_ENV Ruby apps should set APP_ENV Apr 2, 2020
@linjian8 linjian8 reopened this Apr 16, 2020
@taylor-anderson821
Copy link

Reopening. Inadvertently closed when removing the Proposed tag.

@1tonyca
Copy link

1tonyca commented Mar 24, 2022

Closing older issue that we are no longer considering, please do re-open if this is still relevant.

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

5 participants