From f1640a165373f0e52ed36642479f3772318dab1f Mon Sep 17 00:00:00 2001 From: Joshua Peek Date: Fri, 16 Oct 2009 19:31:32 -0500 Subject: script/runner should require environment --- railties/lib/rails/commands/runner.rb | 2 -- railties/lib/rails/generators/rails/app/templates/script/runner.tt | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) (limited to 'railties') diff --git a/railties/lib/rails/commands/runner.rb b/railties/lib/rails/commands/runner.rb index 84d72f9fa9..0246348c77 100644 --- a/railties/lib/rails/commands/runner.rb +++ b/railties/lib/rails/commands/runner.rb @@ -36,8 +36,6 @@ ARGV.delete(code_or_file) ENV["RAILS_ENV"] = options[:environment] RAILS_ENV.replace(options[:environment]) if defined?(RAILS_ENV) -Rails.initialize! - begin if code_or_file.nil? $stderr.puts "Run '#{$0} -h' for help." diff --git a/railties/lib/rails/generators/rails/app/templates/script/runner.tt b/railties/lib/rails/generators/rails/app/templates/script/runner.tt index 872ec07a1e..5fa1883694 100755 --- a/railties/lib/rails/generators/rails/app/templates/script/runner.tt +++ b/railties/lib/rails/generators/rails/app/templates/script/runner.tt @@ -1,3 +1,3 @@ <%= shebang %> -require File.expand_path('../../config/application', __FILE__) +require File.expand_path('../../../config/environment', __FILE__) require 'rails/commands/runner' -- cgit v1.2.3