rails runner loads environment after parsing command-line options
This commit is contained in:
parent
6f247347a1
commit
39ebd6eb2b
|
@ -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
|
||||||
|
|
|
@ -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."
|
||||||
|
|
Loading…
Reference in New Issue