Heroku RACK_ENV says "development" on thin, but "staging" on Unicorn

I came across this behavior and wondered if anyone else had seen this. I have a workaround, so this is not a show stopper.

I created a new application on Heroku with Cedar Cedar. When demonstrating several environments, I added the following var configuration:

heroku config:add RACK_ENV=staging --app appname

I visually verified that the var environment was installed, then enter the following route into my simple Sinatra example:

get '/?' do
  ENV['RACK_ENV']
end

When I tested locally on my laptop, I got the expected development.

When I clicked on Heroku and went the same route on herokuapp.com, I got developmentinstead staging.

I switched the web server from Thin to Unicorn via Procfile and moved the changes back to Heroku.

, , staging.

- ? , Thin, , New Relic. ( Unicorn, , Cedar New Relic and Unicorn ).

+5
2

, - heroku. RACK_ENV , . (Heroku, , , RACK_ENV, 'heroku config' , , ).

.

EDIT: , :

: , Procfile , . Procfile?

web: bundle exec thin start -R config.ru -e $RACK_ENV -p $PORT

+14

RACK_ENV RAILS_ENV Heroku... , . , .

+4

All Articles