Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Ruby

I18n::InvalidLocaleData errors

Hi,

I am getting a peculiar I18n::InvalidLocaleData error in deveolpment mode but not in production mode (eg, I can successfully visit a page on my live heroku app but cannot visit this same page without the error message on the local host).

I have recently added and deleted a few gems that didnt suit my purpose but as far as i can tell they have all been removed and I cannot find what is actually calling anyhting to do with l18n.

any tips on how best to trouble shoot this error would be great

thanks!

2 Answers

Naomi Freeman
STAFF
Naomi Freeman
Treehouse Guest Teacher

It's in

config

  • application.rb

down near the bottom:

    # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
    # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
    # config.i18n.default_locale = :de

Uncomment that #config.i18n.default_locale = :de and change the :de to :en

That might fix it.

Not sure which precise error you have, but play around in that chunk and it'll straighten it out :) It's just yelling about your language settings. They're really important in Europe. We're more concerned with timezones this side of the ocean (settings available just above that chunk about language).

spot on mate! the solution was in that chunk. Not sure what caused the error but one the locale was defined properly everything was back to normal. still strange that it worked in live app but not in local host. Thanks for your help!