heroku language locale not working I18n::MissingTr

2019-05-23 21:49发布

问题:

On my local pc all works fine but on heroku I get a error.

My heroku console:

PC@HOME-PC  /c/rails/konkurranceportalen (master)
$ heroku console
Ruby console for vinderhimlen.heroku.com
>> I18n.l Time.now
I18n::MissingTranslationData: translation missing: da.time.formats.default
        /app/.bundle/gems/ruby/1.9.1/gems/i18n-0.5.0/lib/i18n/backend/fallbacks.
rb:53:in `translate'
        /app/.bundle/gems/ruby/1.9.1/gems/i18n-0.5.0/lib/i18n.rb:155:in `transla
te'
        /app/.bundle/gems/ruby/1.9.1/gems/i18n-0.5.0/lib/i18n/backend/base.rb:55
:in `localize'
        /app/.bundle/gems/ruby/1.9.1/gems/i18n-0.5.0/lib/i18n.rb:235:in `localiz
e'


PC@HOME-PC /c/rails/konkurranceportalen (master)
$ heroku stack
  aspen-mri-1.8.6
  bamboo-ree-1.8.7
* bamboo-mri-1.9.2

PC@HOME-PC  /c/rails/konkurranceportalen (master)
$

回答1:

I had a similar problem, which I fixed by taking out the byte order mark from the localization files.

More info in the question I opened: heroku not loading language file