ruby-on-railsrails-i18n

Uninitialized constant error while upgrading Rails (Ruby on Rails)


I am trying to upgrade Rails from 5.2 to 6.1. That requires i18n to be greater than equal to 1.6 (rails -> activesupport -> i18n), so upgraded the same from 0.7, but keep getting this error.

NameError: uninitialized constant I18n::HashRefinements
Did you mean?  HashWithIndifferentAccess

Any solution for this? Any kind of suggestion will be incredibly helpful.


Solution

  • Add

    require 'i18n/core_ext/hash'

    Where ever you are using I18n.