Redmine:用户配置文件视图中的错误 [英] Redmine: error in user profile view

查看:50
本文介绍了Redmine:用户配置文件视图中的错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我收到此错误:

Processing MyController#account (for 127.0.0.1 at 2012-01-31 13:22:55) [GET]
  Parameters: {"action"=>"account", "controller"=>"my"}
Rendering template within layouts/base
Rendering my/account

ActionView::TemplateError (undefined method `-' for nil:NilClass) on line #11 of app/views/my/_sidebar.html.erb:
8: 
9: <p>
10: <% if @user.rss_token %>
11: <%= l(:label_feeds_access_key_created_on, distance_of_time_in_words(Time.now, @user.rss_token.created_on)) %>
12: <% else %>
13: <%= l(:label_missing_feeds_access_key) %>
14: <% end %>

    app/views/my/_sidebar.html.erb:11
    app/views/my/account.html.erb:48
    app/helpers/application_helper.rb:980:in `content_for'
    app/views/my/account.html.erb:47
    /home/redmine/redmine-buildout/parts/rubygems/lib/ruby/gems/1.8/gems/unicorn-4.1.1/lib/unicorn/http_server.rb:528:in `process_client'
    /home/redmine/redmine-buildout/parts/rubygems/lib/ruby/gems/1.8/gems/unicorn-4.1.1/lib/unicorn/http_server.rb:600:in `worker_loop'
    /home/redmine/redmine-buildout/parts/rubygems/lib/ruby/gems/1.8/gems/unicorn-4.1.1/lib/unicorn/http_server.rb:485:in `spawn_missing_workers'
    /home/redmine/redmine-buildout/parts/rubygems/lib/ruby/gems/1.8/gems/unicorn-4.1.1/lib/unicorn/http_server.rb:135:in `start'
    /home/redmine/redmine-buildout/parts/rubygems/lib/ruby/gems/1.8/gems/unicorn-4.1.1/bin/unicorn_rails:209
    /home/redmine/redmine-buildout/parts/rubygems/bin/unicorn_rails:19:in `load'
    /home/redmine/redmine-buildout/parts/rubygems/bin/unicorn_rails:19

Rendering /home/redmine/redmine-buildout/parts/redmine/public/500.html (500 Internal Server Error)

对于尝试查看/my/account 的某些用户(不是全部).

for some users (not all) when trying to see /my/account.

如果我尝试以管理员身份查看该用户的个人资料,我会得到:

If I try to see that user's profile as an admin I get:

Processing UsersController#show (for 2.157.30.187 at 2012-02-01 14:26:40) [GET]
  Parameters: {"action"=>"show", "id"=>"9", "controller"=>"users"}

NoMethodError (undefined method `<=>' for nil:NilClass):
  lib/redmine/activity/fetcher.rb:80:in `events'
  lib/redmine/activity/fetcher.rb:80:in `sort!'
  lib/redmine/activity/fetcher.rb:80:in `events'
  app/controllers/users_controller.rb:74:in `show'
  /home/redmine/redmine-buildout/parts/rubygems/lib/ruby/gems/1.8/gems/unicorn-4.1.1/lib/unicorn/http_server.rb:528:in `process_client'
  /home/redmine/redmine-buildout/parts/rubygems/lib/ruby/gems/1.8/gems/unicorn-4.1.1/lib/unicorn/http_server.rb:600:in `worker_loop'
  /home/redmine/redmine-buildout/parts/rubygems/lib/ruby/gems/1.8/gems/unicorn-4.1.1/lib/unicorn/http_server.rb:485:in `spawn_missing_workers'
  /home/redmine/redmine-buildout/parts/rubygems/lib/ruby/gems/1.8/gems/unicorn-4.1.1/lib/unicorn/http_server.rb:135:in `start'
  /home/redmine/redmine-buildout/parts/rubygems/lib/ruby/gems/1.8/gems/unicorn-4.1.1/bin/unicorn_rails:209
  /home/redmine/redmine-buildout/parts/rubygems/bin/unicorn_rails:19:in `load'
  /home/redmine/redmine-buildout/parts/rubygems/bin/unicorn_rails:19

Rendering /home/redmine/redmine-buildout/parts/redmine/public/500.html (500 Internal Server Error)

我(未受过教育的)猜测是用户错过了 rss 身份验证令牌.

My (uneducated) guess is that the user misses a rss auth token.

如果是这样的话,你能告诉我一些关于如何重新生成它的文档吗?

If that is the case, can you point me to some docs about how to regenerate it?

推荐答案

postgresql 和 redmine 对字符串日期格式的误解似乎是根本原因(请参阅我对 Declan Lynch 回答的评论).

A misunderstanding between postgresql and redmine on string date formats seemed to be the root cause (see my comment on Declan Lynch answer).

ALTER DATABASE redmine SET DATESTYLE=US;

解决了我所有的问题.

这篇关于Redmine:用户配置文件视图中的错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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