加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

ruby-on-rails – rails app给出错误“无法加载来自{ru.yml path

发布时间:2020-12-16 19:09:24 所属栏目:百科 来源:网络整理
导读:我的应用程序在本地工作正常,但当我将它安装到生产服务器时,我得到以下错误运行rails服务器和请求页面: ActionView::Template::Error (can not load translations from {app}/config/locales/ru.yml,expected it to return a hash,but does not). 我有YAML
我的应用程序在本地工作正常,但当我将它安装到生产服务器时,我得到以下错误运行rails服务器和请求页面:
ActionView::Template::Error (can not load translations from {app}/config/locales/ru.yml,expected it to return a hash,but does not).

我有YAML翻译ru.yml:

ru:
  clients:
    index: 
      title: Список клиентов

调用时发生错误,例如:

%h1=t '.title'

我的开发机器正在运行Mac OS X ML

生产服务器是CentOS 6,安装了rvm和libyaml.

两台服务器都在Ruby 1.9.2p320和Rails 3.2.8上

解决方法

操作YAML.load(File.open(‘config / locales / ru.yml’))给了我一行错误.

我添加了引号:默认:’%d.%m.%Y%H:%M’并得到一个哈希值.问题解决了.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读