lic*_*ich 8 yaml centos ruby-on-rails internationalization centos6
我的应用程序在本地工作正常,但当我将其安装到生产服务器时,我得到以下错误运行rails server和请求页面:
ActionView::Template::Error (can not load translations from {app}/config/locales/ru.yml, expected it to return a hash, but does not).
Run Code Online (Sandbox Code Playgroud)
我有YAML翻译ru.yml:
ru:
clients:
index:
title: ?????? ????????
Run Code Online (Sandbox Code Playgroud)
调用时发生错误,例如:
%h1=t '.title'
Run Code Online (Sandbox Code Playgroud)
我的开发机器正在运行Mac OS X ML
生产服务器是CentOS 6,安装了rvm和libyaml.
两台服务器都在Ruby 1.9.2p320和Rails 3.2.8上
操作YAML.load(File.open('config/locales/ru.yml'))给了我一行错误.
我添加了引号:default: '%d.%m.%Y %H:%M'并得到了哈希.问题解决了.