I've updated to Rails 4.0.2 and I got the deprecation warning:
[deprecated] I18n.enforce_available_locales will default to true in the future. If you really want to skip validation of your locale you can set I18n.enforce_available_locales = false to avoid this message.
To get rid of the warning, I decided to set:
I18n.config.enforce_available_locales = true
config.i18n.default_locale = :es
in my config/application.rb file.
It worked on Development but when I deploy my work to Heroku I get following error:
-----> Writing config/database.yml to read from DATABASE_URL
-----> Preparing app for Rails asset pipeline
Running: rake assets:precompile
rake aborted!
:es is not a valid locale
/tmp/build_e6bd0f83-f9f7-45ad-9d98-13384d9403dc/vendor/bundle/ruby/2.1.0/gems/i18n-0.6.9/lib/i18n.rb:288:in `enforce_available_locales!'
/tmp/build_e6bd0f83-f9f7-45ad-9d98-13384d9403dc/vendor/bundle/ruby/2.1.0/gems/i18n-0.6.9/lib/i18n/config.rb:32:in `default_locale='
/tmp/build_e6bd0f83-f9f7-45ad-9d98-13384d9403dc/vendor/bundle/ruby/2.1.0/gems/i18n-0.6.9/lib/i18n.rb:35:in `default_locale='
/tmp/build_e6bd0f83-f9f7-45ad-9d98-13384d9403dc/vendor/bundle/ruby/2.1.0/gems/activesupport-4.0.2/lib/active_support/i18n_railtie.rb:41:in `block in initialize_i18n'
/tmp/build_e6bd0f83-f9f7-45ad-9d98-13384d9403dc/vendor/bundle/ruby/2.1.0/gems/activesupport-4.0.2/lib/active_support/i18n_railtie.rb:34:in `each'
/tmp/build_e6bd0f83-f9f7-45ad-9d98-13384d9403dc/vendor/bundle/ruby/2.1.0/gems/activesupport-4.0.2/lib/active_support/i18n_railtie.rb:34:in `initialize_i18n'
/tmp/build_e6bd0f83-f9f7-45ad-9d98-13384d9403dc/vendor/bundle/ruby/2.1.0/gems/activesupport-4.0.2/lib/active_support/i18n_railtie.rb:15:in `block in <class:Railtie>'
/tmp/build_e6bd0f83-f9f7-45ad-9d98-13384d9403dc/vendor/bundle/ruby/2.1.0/gems/activesupport-4.0.2/lib/active_support/lazy_load_hooks.rb:36:in `call'
/tmp/build_e6bd0f83-f9f7-45ad-9d98-13384d9403dc/vendor/bundle/ruby/2.1.0/gems/activesupport-4.0.2/lib/active_support/lazy_load_hooks.rb:36:in `execute_hook'
/tmp/build_e6bd0f83-f9f7-45ad-9d98-13384d9403dc/vendor/bundle/ruby/2.1.0/gems/activesupport-4.0.2/lib/active_support/lazy_load_hooks.rb:45:in `block in run_load_hooks'
/tmp/build_e6bd0f83-f9f7-45ad-9d98-13384d9403dc/vendor/bundle/ruby/2.1.0/gems/activesupport-4.0.2/lib/active_support/lazy_load_hooks.rb:44:in `each'
/tmp/build_e6bd0f83-f9f7-45ad-9d98-13384d9403dc/vendor/bundle/ruby/2.1.0/gems/activesupport-4.0.2/lib/active_support/lazy_load_hooks.rb:44:in `run_load_hooks'
/tmp/build_e6bd0f83-f9f7-45ad-9d98-13384d9403dc/vendor/bundle/ruby/2.1.0/gems/railties-4.0.2/lib/rails/application/finisher.rb:62:in `block in <module:Finisher>'
/tmp/build_e6bd0f83-f9f7-45ad-9d98-13384d9403dc/vendor/bundle/ruby/2.1.0/gems/railties-4.0.2/lib/rails/initializable.rb:30:in `instance_exec'
/tmp/build_e6bd0f83-f9f7-45ad-9d98-13384d9403dc/vendor/bundle/ruby/2.1.0/gems/railties-4.0.2/lib/rails/initializable.rb:30:in `run'
/tmp/build_e6bd0f83-f9f7-45ad-9d98-13384d9403dc/vendor/bundle/ruby/2.1.0/gems/railties-4.0.2/lib/rails/initializable.rb:55:in `block in run_initializers'
/tmp/build_e6bd0f83-f9f7-45ad-9d98-13384d9403dc/vendor/bundle/ruby/2.1.0/gems/railties-4.0.2/lib/rails/initializable.rb:54:in `run_initializers'
/tmp/build_e6bd0f83-f9f7-45ad-9d98-13384d9403dc/vendor/bundle/ruby/2.1.0/gems/railties-4.0.2/lib/rails/application.rb:215:in `initialize!'
/tmp/build_e6bd0f83-f9f7-45ad-9d98-13384d9403dc/vendor/bundle/ruby/2.1.0/gems/railties-4.0.2/lib/rails/railtie/configurable.rb:30:in `method_missing'
/tmp/build_e6bd0f83-f9f7-45ad-9d98-13384d9403dc/config/environment.rb:5:in `<top (required)>'
/tmp/build_e6bd0f83-f9f7-45ad-9d98-13384d9403dc/vendor/bundle/ruby/2.1.0/gems/activesupport-4.0.2/lib/active_support/dependencies.rb:229:in `require'
/tmp/build_e6bd0f83-f9f7-45ad-9d98-13384d9403dc/vendor/bundle/ruby/2.1.0/gems/activesupport-4.0.2/lib/active_support/dependencies.rb:229:in `block in require'
/tmp/build_e6bd0f83-f9f7-45ad-9d98-13384d9403dc/vendor/bundle/ruby/2.1.0/gems/activesupport-4.0.2/lib/active_support/dependencies.rb:214:in `load_dependency'
/tmp/build_e6bd0f83-f9f7-45ad-9d98-13384d9403dc/vendor/bundle/ruby/2.1.0/gems/activesupport-4.0.2/lib/active_support/dependencies.rb:229:in `require'
/tmp/build_e6bd0f83-f9f7-45ad-9d98-13384d9403dc/vendor/bundle/ruby/2.1.0/gems/railties-4.0.2/lib/rails/application.rb:189:in `require_environment!'
/tmp/build_e6bd0f83-f9f7-45ad-9d98-13384d9403dc/vendor/bundle/ruby/2.1.0/gems/railties-4.0.2/lib/rails/application.rb:250:in `block in run_tasks_blocks'
/tmp/build_e6bd0f83-f9f7-45ad-9d98-13384d9403dc/vendor/bundle/ruby/2.1.0/gems/sprockets-rails-2.0.1/lib/sprockets/rails/task.rb:54:in `block (2 levels) in define'
Any ideas how to avoid this error?
Thanks
config/locales/es.yml
file? – Ari