I have this on line 56 in my environment.rb:
I18n.load_path += Dir[ File.join(RAILS_ROOT, 'lib', 'locale', '*.{rb,yml}') ]
I can run the app just fine, but when I try to run: script/generate migration
I get this error:
environment.rb:56: uninitialized constant I18n (NameError)
What gives?
By default,
active_support(where theI18nmodule is located) is not loaded in yourenvironment.rb. The proper way to add directories to your i18n load path is by the following in yourenvironment.rb:I think, as an alternative, you might be able to throw in a
require 'active_support'before your reference to theI18nmodule in yourenvironment.rb, but it doesn’t seem like a good idea.