2015-04-02 55 views
0

何在一起,運行rails 2.0.0時出錯。 「德」是無效的語言代碼化(I18n :: InvalidLocale)

我遇到了一些問題,UTF8和ASCII,在這種情況下,我試圖從紅寶石1.9.3升級到2.0.0紅寶石

是工作,但現在當我要開始我的應用程序,我得到這個錯誤:

/home/felix/.rvm/gems/ruby-2.0.0-p643/gems/i18n-0.7.0/lib/i18n.rb:284:in `enforce_available_locales!': :"de-DE" is not a valid locale (I18n::InvalidLocale) 
    from /home/felix/.rvm/gems/ruby-2.0.0-p643/gems/i18n-0.7.0/lib/i18n/config.rb:34:in `default_locale=' 
    from /home/felix/.rvm/gems/ruby-2.0.0-p643/gems/i18n-0.7.0/lib/i18n.rb:35:in `default_locale=' 
    from /var/www/xyz/xyz/config/application.rb:79:in `<top (required)>' 
    from /home/felix/.rvm/gems/ruby-2.0.0-p643/gems/railties-3.2.12/lib/rails/commands.rb:53:in `require' 
    from /home/felix/.rvm/gems/ruby-2.0.0-p643/gems/railties-3.2.12/lib/rails/commands.rb:53:in `block in <top (required)>' 
    from /home/felix/.rvm/gems/ruby-2.0.0-p643/gems/railties-3.2.12/lib/rails/commands.rb:50:in `tap' 
    from /home/felix/.rvm/gems/ruby-2.0.0-p643/gems/railties-3.2.12/lib/rails/commands.rb:50:in `<top (required)>' 
    from script/rails:6:in `require' 
    from script/rails:6:in `<main>' 

我已經設置了

default_locale: de 
在settings.yml中

怎麼回事?我該如何解決它?我在debian下7上運行和軌道3.2.12

+0

也許試圖'de_DE'會有幫助嗎? – 2015-04-02 09:39:43

+0

我試過了,但是同樣的錯誤:'enforce_available_locales!'::de_DE不是有效的區域設置(I18n :: InvalidLocale)' – Felix 2015-04-02 09:40:40

回答

1

你能嘗試:

config.i18n.enforce_available_locales = false 
config.i18n.available_locales = ["de_DE", :en] 
config.i18n.default_locale = :'de_DE' 

讓我知道是否有幫助?

+0

我應該在application.rb中添加這個嗎? – Felix 2015-04-02 09:50:58

+0

好吧應用程序啓動...但沒有與紅寶石2.0.0 如果我運行'軌道s'它開始於2.0.0,但然後我沒有訪問權 如果我運行'sudo rails s'它啓動與1.9.3 .... – Felix 2015-04-02 09:55:58

+0

是的,在'config/application.rb' – Thomas 2015-04-02 09:59:19

0

嘗試降級版本 - >寶石「國際化」,「0.6.0」的Gemfile中,然後運行「捆綁更新國際化」