diff options
Diffstat (limited to 'railties/lib/initializer.rb')
-rw-r--r-- | railties/lib/initializer.rb | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/railties/lib/initializer.rb b/railties/lib/initializer.rb index be65950a5b..d0ef9d0c2f 100644 --- a/railties/lib/initializer.rb +++ b/railties/lib/initializer.rb @@ -569,10 +569,9 @@ Run `rake gems:install` to install the missing gems. end end - # Load generators if RAILS_ENV == "generators" + # Configure generators if they were already loaded Initializer.default.add :initialize_generators do - if RAILS_ENV == "generators" - require "generators" + if defined?(Rails::Generators) Rails::Generators.no_color! unless config.generators.colorize_logging Rails::Generators.aliases.merge! config.generators.aliases Rails::Generators.options.merge! config.generators.options |