Skip to content

Commit

Permalink
Remove RAILS_ENV declarations
Browse files Browse the repository at this point in the history
The proper way to access Rails' environment is through `Rails.env`,
which checks `RAILS_ENV`, falling back to `RACK_ENV`.
  • Loading branch information
seanpdoyle committed Mar 4, 2016
1 parent b81ac1e commit 4d4a9a0
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 6 deletions.
2 changes: 2 additions & 0 deletions NEWS.md
@@ -1,3 +1,5 @@
* Remove `RAILS_ENV` definitions

1.36.0 (February 26, 2016)

* Update Bitters to v1.2
Expand Down
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -129,7 +129,7 @@ This:

* Creates a staging and production Heroku app
* Sets them as `staging` and `production` Git remotes
* Configures staging with `RACK_ENV` and `RAILS_ENV` environment variables set
* Configures staging with `RACK_ENV` environment variable set
to `staging`
* Adds the [Rails Stdout Logging][logging-gem] gem
to configure the app to log to standard out,
Expand Down
2 changes: 1 addition & 1 deletion lib/suspenders/adapters/heroku.rb
Expand Up @@ -25,7 +25,7 @@ def set_up_heroku_specific_gems
end

def create_staging_heroku_app(flags)
rack_env = "RACK_ENV=staging RAILS_ENV=staging"
rack_env = "RACK_ENV=staging"
app_name = heroku_app_name_for("staging")

run_toolbelt_command "create #{app_name} #{flags}", "staging"
Expand Down
3 changes: 0 additions & 3 deletions templates/app.json.erb
Expand Up @@ -17,9 +17,6 @@
"RACK_ENV":{
"required":true
},
"RAILS_ENV":{
"required":true
},
"SECRET_KEY_BASE":{
"generator":"secret"
},
Expand Down
2 changes: 1 addition & 1 deletion templates/rails_helper.rb
@@ -1,4 +1,4 @@
ENV["RAILS_ENV"] = "test"
ENV["RACK_ENV"] = "test"

require File.expand_path("../../config/environment", __FILE__)
abort("DATABASE_URL environment variable is set") if ENV["DATABASE_URL"]
Expand Down

0 comments on commit 4d4a9a0

Please sign in to comment.