diff options
author | Jeremy Kemper <jeremykemper@gmail.com> | 2015-03-20 08:14:11 -0700 |
---|---|---|
committer | Jeremy Kemper <jeremykemper@gmail.com> | 2015-03-20 08:14:11 -0700 |
commit | 5154089c181e9b36753b193bd7ffb141e88232f1 (patch) | |
tree | e72783fd1351026a4bd8847127abba222f44d118 /railties/lib/rails/commands | |
parent | a4e7a6f9d63b93fff4ba78a32a930d1f5f97da29 (diff) | |
download | rails-5154089c181e9b36753b193bd7ffb141e88232f1.tar.gz rails-5154089c181e9b36753b193bd7ffb141e88232f1.tar.bz2 rails-5154089c181e9b36753b193bd7ffb141e88232f1.zip |
Revert "Merge pull request #19404 from dmathieu/remove_rack_env"
Preserving RACK_ENV behavior.
This reverts commit 7bdc7635b885e473f6a577264fd8efad1c02174f, reversing
changes made to 45786be516e13d55a1fca9a4abaddd5781209103.
Diffstat (limited to 'railties/lib/rails/commands')
-rw-r--r-- | railties/lib/rails/commands/console.rb | 2 | ||||
-rw-r--r-- | railties/lib/rails/commands/dbconsole.rb | 2 | ||||
-rw-r--r-- | railties/lib/rails/commands/runner.rb | 2 | ||||
-rw-r--r-- | railties/lib/rails/commands/server.rb | 2 |
4 files changed, 4 insertions, 4 deletions
diff --git a/railties/lib/rails/commands/console.rb b/railties/lib/rails/commands/console.rb index 48b1ad884b..5d37a2b699 100644 --- a/railties/lib/rails/commands/console.rb +++ b/railties/lib/rails/commands/console.rb @@ -57,7 +57,7 @@ module Rails end def environment - options[:environment] ||= ENV['RAILS_ENV'] || 'development' + options[:environment] ||= ENV['RAILS_ENV'] || ENV['RACK_ENV'] || 'development' end def environment? diff --git a/railties/lib/rails/commands/dbconsole.rb b/railties/lib/rails/commands/dbconsole.rb index be0c0fc659..5175e31f14 100644 --- a/railties/lib/rails/commands/dbconsole.rb +++ b/railties/lib/rails/commands/dbconsole.rb @@ -107,7 +107,7 @@ module Rails if Rails.respond_to?(:env) Rails.env else - ENV["RAILS_ENV"] || "development" + ENV["RAILS_ENV"] || ENV["RACK_ENV"] || "development" end end diff --git a/railties/lib/rails/commands/runner.rb b/railties/lib/rails/commands/runner.rb index 66a9ebf38c..86bce9b2fe 100644 --- a/railties/lib/rails/commands/runner.rb +++ b/railties/lib/rails/commands/runner.rb @@ -1,6 +1,6 @@ require 'optparse' -options = { environment: (ENV['RAILS_ENV'] || "development").dup } +options = { environment: (ENV['RAILS_ENV'] || ENV['RACK_ENV'] || "development").dup } code_or_file = nil if ARGV.first.nil? diff --git a/railties/lib/rails/commands/server.rb b/railties/lib/rails/commands/server.rb index 397a9cf406..546d3725d8 100644 --- a/railties/lib/rails/commands/server.rb +++ b/railties/lib/rails/commands/server.rb @@ -95,7 +95,7 @@ module Rails super.merge({ Port: 3000, DoNotReverseLookup: true, - environment: (ENV['RAILS_ENV'] || "development").dup, + environment: (ENV['RAILS_ENV'] || ENV['RACK_ENV'] || "development").dup, daemonize: false, pid: File.expand_path("tmp/pids/server.pid"), config: File.expand_path("config.ru") |