Switching enviornments (test, dev, prod)

I have built an application that I have been testing locally. I was
experimenting with deploying it and switching to different
“environments”. It seems that locally the only way I can change the
environment and actually have it reflect is by changing the boot.rb

ENV[‘RAILS_ENV’] ||= ‘production’

I’ve tried uncommenting that same EVN[’… code in the environment.rb
file but it doesn’t actually switch the environment. it still uses

I’ve even tried the “ruby script/server --environment=production” when
starting the server and that doesn’t work.

This concerns me for actual deployment time.

Has anyone experienced this? What more can I do to look into this or
fix it?