Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Introduce APP_ENV and remove RACK_ENV #984
In fact, it can even cause some issues if your app is using unicorn, as they're including internal rack middlewares relying on
Rack itself does that too.
This removes using
referenced this pull request
Mar 26, 2015
TL;DR: Nobody's been doing it wrong; RACK_ENV is the Rack app environment. Rack::Server had an
@dmathieu How do you feel about this:
# warn if RACK_ENV is set, to recommend SINATRA_ENV here, then: set :environment, (ENV['SINATRA_ENV'] || ENV['RACK_ENV'] || :development).to_sym
This would allow users to choose
I don't think we can simply ignore
All of these pieces (Rails, Sinatra, puma, thin, sidekiq, etc) are all application infrastructure processes. We want to determine what environment this application process is running in. Why not
One thing I'll add to the discussion regarding this is, APP_ENV only seems appropriate if everyone wasn't using Rack to begin with.
We might as well just use
But since I feel that ship has sailed, I'm ok with using
I don't mind being the first.
@dmathieu Ok, lets change it to
Worst case, we're ahead of the curve which never gains traction and we just introduce Yet Another Environment Variable to peoples apps. In which case, we do anyways if it was