aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib
diff options
context:
space:
mode:
authorJamis Buck <jamis@37signals.com>2005-10-14 02:51:33 +0000
committerJamis Buck <jamis@37signals.com>2005-10-14 02:51:33 +0000
commit4b78e5bddbf75a803452fd69f077b6c1ef1c267d (patch)
treefcdb56edfdcfea44dc25983be527915e157cc604 /railties/lib
parentcb24c0f14158b392e86b5948c6091398aab0a968 (diff)
downloadrails-4b78e5bddbf75a803452fd69f077b6c1ef1c267d.tar.gz
rails-4b78e5bddbf75a803452fd69f077b6c1ef1c267d.tar.bz2
rails-4b78e5bddbf75a803452fd69f077b6c1ef1c267d.zip
Fix problem with RAILS_ENV being frozen when set from environment variable
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2576 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'railties/lib')
-rw-r--r--railties/lib/commands/runner.rb2
-rw-r--r--railties/lib/commands/server.rb2
-rw-r--r--railties/lib/initializer.rb2
3 files changed, 3 insertions, 3 deletions
diff --git a/railties/lib/commands/runner.rb b/railties/lib/commands/runner.rb
index 49827c3812..27a2cf33d6 100644
--- a/railties/lib/commands/runner.rb
+++ b/railties/lib/commands/runner.rb
@@ -1,6 +1,6 @@
require 'optparse'
-options = { :environment => "development" }
+options = { :environment => (ENV['RAILS_ENV'] || "development").dup }
ARGV.options do |opts|
script_name = File.basename($0)
diff --git a/railties/lib/commands/server.rb b/railties/lib/commands/server.rb
index 375fb4df07..db8e8b3d93 100644
--- a/railties/lib/commands/server.rb
+++ b/railties/lib/commands/server.rb
@@ -4,7 +4,7 @@ require 'optparse'
OPTIONS = {
:port => 3000,
:ip => "0.0.0.0",
- :environment => "development",
+ :environment => (ENV['RAILS_ENV'] || "development").dup,
:server_root => File.expand_path(RAILS_ROOT + "/public/"),
:server_type => WEBrick::SimpleServer,
:charset => "UTF-8",
diff --git a/railties/lib/initializer.rb b/railties/lib/initializer.rb
index adcf5e274d..f6be1bb1ea 100644
--- a/railties/lib/initializer.rb
+++ b/railties/lib/initializer.rb
@@ -1,6 +1,6 @@
require 'logger'
-RAILS_ENV = ENV['RAILS_ENV'] || 'development' unless defined?(RAILS_ENV)
+RAILS_ENV = (ENV['RAILS_ENV'] || 'development').dup unless defined?(RAILS_ENV)
module Rails
# The Initializer is responsible for processing the Rails configuration, such as setting the $LOAD_PATH, requiring the