当我尝试启动控制台时,我得到
/home/username/.rvm/gems/ruby-1.9.2-p320/gems/i18n-0.6.1/lib/i18n/backend/base.rb:158:in `load_file': can not load translations from /var/www/railsapp/config/locales/ru.yml, expected it to return a hash, but does not (I18n::InvalidLocaleData)
from /home/username/.rvm/gems/ruby-1.9.2-p320/gems/i18n-0.6.1/lib/i18n/backend/base.rb:15:in `block in load_translations'
from /home/username/.rvm/gems/ruby-1.9.2-p320/gems/i18n-0.6.1/lib/i18n/backend/base.rb:15:in `each'
from /home/username/.rvm/gems/ruby-1.9.2-p320/gems/i18n-0.6.1/lib/i18n/backend/base.rb:15:in `load_translations'
from /home/username/.rvm/gems/ruby-1.9.2-p320/gems/i18n-0.6.1/lib/i18n/backend/simple.rb:57:in `init_translations'
from /home/username/.rvm/gems/ruby-1.9.2-p320/gems/i18n-0.6.1/lib/i18n/backend/simple.rb:71:in `lookup'
from /home/username/.rvm/gems/ruby-1.9.2-p320/gems/i18n-0.6.1/lib/i18n/backend/base.rb:26:in `translate'
from /home/username/.rvm/gems/ruby-1.9.2-p320/gems/i18n-0.6.1/lib/i18n.rb:156:in `block in translate'
from /home/username/.rvm/gems/ruby-1.9.2-p320/gems/i18n-0.6.1/lib/i18n.rb:152:in `catch'
from /home/username/.rvm/gems/ruby-1.9.2-p320/gems/i18n-0.6.1/lib/i18n.rb:152:in `translate'
from /home/username/.rvm/gems/ruby-1.9.2-p320/gems/activerecord-3.1.0/lib/active_record/railtie.rb:102:in `block in <class:Railtie>'
from /home/username/.rvm/gems/ruby-1.9.2-p320/gems/activesupport-3.1.0/lib/active_support/lazy_load_hooks.rb:34:in `call'
from /home/username/.rvm/gems/ruby-1.9.2-p320/gems/activesupport-3.1.0/lib/active_support/lazy_load_hooks.rb:34:in `execute_hook'
from /home/username/.rvm/gems/ruby-1.9.2-p320/gems/activesupport-3.1.0/lib/active_support/lazy_load_hooks.rb:43:in `block in run_load_hooks'
from /home/username/.rvm/gems/ruby-1.9.2-p320/gems/activesupport-3.1.0/lib/active_support/lazy_load_hooks.rb:42:in `each'
from /home/username/.rvm/gems/ruby-1.9.2-p320/gems/activesupport-3.1.0/lib/active_support/lazy_load_hooks.rb:42:in `run_load_hooks'
from /home/username/.rvm/gems/ruby-1.9.2-p320/gems/railties-3.1.0/lib/rails/application/finisher.rb:56:in `block in <module:Finisher>'
from /home/username/.rvm/gems/ruby-1.9.2-p320/gems/railties-3.1.0/lib/rails/initializable.rb:25:in `instance_exec'
from /home/username/.rvm/gems/ruby-1.9.2-p320/gems/railties-3.1.0/lib/rails/initializable.rb:25:in `run'
from /home/username/.rvm/gems/ruby-1.9.2-p320/gems/railties-3.1.0/lib/rails/initializable.rb:50:in `block in run_initializers'
from /home/username/.rvm/gems/ruby-1.9.2-p320/gems/railties-3.1.0/lib/rails/initializable.rb:49:in `each'
from /home/username/.rvm/gems/ruby-1.9.2-p320/gems/railties-3.1.0/lib/rails/initializable.rb:49:in `run_initializers'
from /home/username/.rvm/gems/ruby-1.9.2-p320/gems/railties-3.1.0/lib/rails/application.rb:92:in `initialize!'
from /home/username/.rvm/gems/ruby-1.9.2-p320/gems/railties-3.1.0/lib/rails/railtie/configurable.rb:30:in `method_missing'
from /var/www/railsapp/config/environment.rb:6:in `<top (required)>'
from /home/username/.rvm/gems/ruby-1.9.2-p320/gems/railties-3.1.0/lib/rails/application.rb:78:in `require'
from /home/username/.rvm/gems/ruby-1.9.2-p320/gems/railties-3.1.0/lib/rails/application.rb:78:in `require_environment!'
from /home/username/.rvm/gems/ruby-1.9.2-p320/gems/railties-3.1.0/lib/rails/commands.rb:39:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
我的应用程序运行良好,只有控制台无法启动。可能这个问题与从第二个 rails 版本升级有关。但一年来,它一直运行良好。
我的 ru.yml:
ru:
activerecord:
attributes:
user:
password: "Пароль"
login: "Имя пользователя"
password_confirmation: "Повтор пороля"
models:
user: "пользователь"
这是一个幻想错误。从 ru.yml 删除评论后,一切正常。