aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib/commands
diff options
context:
space:
mode:
Diffstat (limited to 'railties/lib/commands')
-rw-r--r--railties/lib/commands/console.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/railties/lib/commands/console.rb b/railties/lib/commands/console.rb
index 0aed60152c..6e61acb22f 100644
--- a/railties/lib/commands/console.rb
+++ b/railties/lib/commands/console.rb
@@ -12,7 +12,7 @@ libs = " -r irb/completion"
libs << " -r #{RAILS_ROOT}/config/environment"
libs << " -r console_sandbox" if options[:sandbox]
-ENV['RAILS_ENV'] = ARGV.first || 'development'
+ENV['RAILS_ENV'] = ARGV.first || ENV['RAILS_ENV'] || 'development'
if options[:sandbox]
puts "Loading #{ENV['RAILS_ENV']} environment in sandbox."
puts "Any modifications you make will be rolled back on exit."