Project

General

Profile

undefined method enforce_available_locales

Added by Matt McMinn over 7 years ago

I've been successfully using Redmine 3.2.2 for several months on one of my systems, and recently something was upgraded which seems to have broken Redmine; I'm not sure exactly what the trigger was. The error message that I'm getting when I try to visit the Redmine URL is:

undefined method `enforce_available_locales=' for I18n:Module (NoMethodError) /usr/share/redmine-3.3.1/config/application.rb:31:in `' /usr/share/redmine-3.3.1/config/application.rb:8:in `' /usr/share/redmine-3.3.1/config/application.rb:7:in `' /usr/share/redmine-3.3.1/config/environment.rb:2:in `require' /usr/share/redmine-3.3.1/config/environment.rb:2:in `' config.ru:3:in `require' config.ru:3:in `block in
' /usr/lib/ruby/vendor_ruby/rack/builder.rb:51:in `instance_eval' /usr/lib/ruby/vendor_ruby/rack/builder.rb:51:in `initialize' config.ru:1:in `new' config.ru:1:in `
' /usr/share/passenger/helper-scripts/rack-preloader.rb:82:in `eval' /usr/share/passenger/helper-scripts/rack-preloader.rb:82:in `preload_app' /usr/share/passenger/helper-scripts/rack-preloader.rb:127:in `' /usr/share/passenger/helper-scripts/rack-preloader.rb:6:in `' /usr/share/passenger/helper-scripts/rack-preloader.rb:5:in `
' 

application.rb:31 is I18n.enforce_available_locales = true.

From some googling, I've found that this seems to be related to using old versions of the i18n gem, but as far as I can tell (not being a Ruby dev) redmine should be using v0.7.0 (which is reported to work in other threads):

$bundle show i18n
/var/lib/gems/1.9.1/gems/i18n-0.7.0

I've tried setting the configuration to false to try skipping locale validation, as shown here, but that hasn't helped at all; the error simply gets thrown on the config line instead of the line shown above. I also tried updating to the latest Redmine (3.3.1) but I get the same error there.

Any ideas what could have gone wrong? Thanks!

Redmine: 3.3.1
OS: Debian Jessie
Ruby version: ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-linux]


Replies (2)

RE: undefined method enforce_available_locales - Added by Toshi MARUYAMA over 7 years ago

#23964#note-1

Why do you use such very old Ruby?

#23964#note-3

I recommend you to use rvm or rbenv instead of package ruby.

RE: undefined method enforce_available_locales - Added by Matt McMinn over 7 years ago

I first updated to ruby 2.3.1 (which I believe is the latest stable version), but that didn't do the trick either; I ended up with the same errors after doing a bundler install.

I then went ahead and did a full upgrade on the system to the latest Jessie, and that fixed the problem. No idea what the actual cause was though, but at least I can get back into my Redmine install.

Thanks!

    (1-2/2)