Rails RedmineI 18n::ArgumentError

small_fish__ · 2012年11月21日 · 最后由 small_fish__ 回复于 2012年11月22日 · 3109 次阅读

今天遇到一个很奇怪的问题,我的 redmine 在 development 模式下没有任何问题,但是以 production 模式的时候就报错了; 错误信息如下:

I18n::ArgumentError in Welcome#index

Showing app/views/welcome/index.html.erb where line #1 raised:

Object must be a Date, DateTime or Time object. :label_home given.
Extracted source (around line #1):

1: <h2><%= l(:label_home) %></h2>
2: 
3: <div class="splitcontentleft">
4:   <%= textilizable Setting.welcome_text %>
RAILS_ROOT: /home/sjy/workspace/tuan800/redmine

Application Trace | Framework Trace | Full Trace
/home/sjy/.rvm/gems/ruby-1.8.7-p371/gems/i18n-0.6.1/lib/i18n/backend/base.rb:49:in `localize'
/home/sjy/.rvm/gems/ruby-1.8.7-p371/gems/i18n-0.6.1/lib/i18n.rb:236:in `localize'
/home/sjy/.rvm/gems/ruby-1.8.7-p371/gems/actionpack-2.3.14/lib/action_view/helpers/translation_helper.rb:38:in `l'
/home/sjy/workspace/tuan800/redmine/app/views/welcome/index.html.erb:1:in `_run_erb_app47views47welcome47index46html46erb'

google 了很久,还是没有找到答案,希望大家帮忙看看!!

Object must be a Date, DateTime or Time object. :label_home given.

你是不是想用 t 这个方法,却用了l

redmine 是不是自定义了 l方法?

觉得是 i18n 版本的问题。建议把你的环境列出来,最好排个版

#2 楼 @zhangyuan #1 楼 @zhangyuan 问题解决,rails 方法被污了

#3 楼 @small_fish__ 就是说 redmine 覆盖了 l方法?

#4 楼 @zhangyuan 自己写的方法覆盖了 l

需要 登录 后方可回复, 如果你还没有账号请 注册新账号