2012-02-01 63 views
2

我得到這個錯誤:管理平臺:錯誤的用戶配置文件視圖

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) 

對一些用戶(不是全部)想看看時/我的/帳戶。

如果我嘗試地看到,用戶的個人資料作爲管理員,我得到:

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的身份驗證令牌。

如果是這樣的話,你可以指點一些關於如何重新生成它的文檔嗎?

回答

0

在字符串日期格式上postgresql和redmine之間的誤解似乎是根本原因(請參閱我對Declan Lynch答覆的評論)。

ALTER DATABASE redmine SET DATESTYLE=US; 

解決了我所有的問題。

2

您是否最近升級了Redmine?

只是爲了安全起見,我會建議運行升級後遷移以確保所有表都設置正確。

rake generate_session_store 
rake db:migrate RAILS_ENV=production 
rake db:migrate_plugins RAILS_ENV=production 
rake tmp:cache:clear 
rake tmp:sessions:clear 

一旦命令已經完成重新啓動Web服務器,看看是否有幫助。

+0

謝謝,但事實並非如此:這是全新的安裝。我可能找到了原因:我注意到昨天(1月31日)據報道,一名用戶被報告爲一個月大。我想它與Postgres數據庫配置和月/日訂購有關。 – silviot 2012-02-01 15:01:08