Fix release stage

Rails does not need to set `RAILS_ENV` to run. In some situations, only `RACK_ENV` exists and `Rails.env` can handle both of the env and return proper env.
I think we should follow the return value of `Rails.env`