Where is the Rails.env set in rails?

when using ruby on rails, I often see Rails.env.development? Rails.env.production? Such an expression. Print Rails.env, directly to get development"s answer. I looked all over the configuration file, but I don"t know where it was configured. Is it the RAILS_ENV parameter specified at startup that you read here? And, if this RAILS_ENV parameter is not passed, the default is development?

I don"t know how to use rails, at first. Please give me some guidance. Thank you very much.

Oct.21,2021

look at document . The value of rails.env is the value of the RAILS_ENV environment variable.

  

there are two environment variables, RAILS_ENV and RACK_ENV, default to development

Menu