time_ago_in_words => “in {{count}} days。”? [英] time_ago_in_words => "in {{count}} days."?

查看:111
本文介绍了time_ago_in_words => “in {{count}} days。”?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个非常奇怪的错误。在我的代码中,我有<%= time_ago_in_words(game.created_at)%>

I'm having a very weird bug. In my code I have <%= time_ago_in_words(game.created_at) %>

在我的分阶段服务器上,但不在我的生产服务器上:

It's works locally and on my staging server but NOT on my production server:

示例: http://hockey-community.com/games/show/45

我得到了 in {{count }} days。

I get "in {{count}} days."

很奇怪,如果返回的数字是1, (例如: 1小时前或1天前)。

Weirdly, if the number returned is 1, it works. (ex: 1 hour ago or 1 day ago).

任何想法都会非常有帮助。 Thails

Any idea would be very helpful. Thks

推荐答案

Rails在帮助程序中使用一些已弃用的语法,然后在最新的Ruby版本中删除。如果你使用的东西像Heroku,请告诉你的生产实例使用Rails 2.3.9。

Rails was using some deprecated syntax in the helper which then got dropped in the latest Ruby version. If you are using something like Heroku, try telling your production instance to use Rails 2.3.9. Otherwise you can also try downgrading Ruby.

请参阅changelog:
http://weblog.rubyonrails.org/2010/9/4/ruby-on-rails-2-3-9-released

See the changelog: http://weblog.rubyonrails.org/2010/9/4/ruby-on-rails-2-3-9-released


将i18n命名插值语法从已弃用的Hello {{name}} 更改为1.9原生Hello %{name}

Changes i18n named-interpolation syntax from the deprecated Hello {{name}} to the 1.9-native Hello %{name}.

这看起来像会解决您的问题。

This looks like it will fix your problem.

这篇关于time_ago_in_words =&gt; “in {{count}} days。”?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆