rails runner loads environment after parsing command-line options

This commit is contained in:
Jeremy Kemper 2010-02-09 08:40:06 -08:00
parent 6f247347a1
commit 39ebd6eb2b
2 changed files with 2 additions and 2 deletions

View File

@ -58,8 +58,6 @@ when 'plugin'
require 'rails/commands/plugin' require 'rails/commands/plugin'
when 'runner' when 'runner'
require 'rails/commands/runner' require 'rails/commands/runner'
require ENV_PATH
when '--help', '-h' when '--help', '-h'
puts HELP_TEXT puts HELP_TEXT

View File

@ -35,6 +35,8 @@ ARGV.delete(code_or_file)
ENV["RAILS_ENV"] = options[:environment] ENV["RAILS_ENV"] = options[:environment]
require ENV_PATH
begin begin
if code_or_file.nil? if code_or_file.nil?
$stderr.puts "Run '#{$0} -h' for help." $stderr.puts "Run '#{$0} -h' for help."