ActiveRecord::StatementInvalid in Welcome#index

Showing layouts/base.rhtml where line #37 raised:

Mysql::Error: Unknown column 'members.role_id' in 'on clause': SELECT count(DISTINCT `members`.id) AS count_all FROM `members`  LEFT OUTER JOIN `projects` ON `projects`.id = `members`.project_id  LEFT OUTER JOIN `roles` ON `roles`.id = `members`.role_id WHERE (`members`.user_id = 3 AND (projects.status=1)) 

Extracted source (around line #37):

34:         <%= link_to l(:label_search), {:controller => 'search', :action => 'index', :id => @project}, :accesskey => accesskey(:search) %>:
35:         <%= text_field_tag 'q', @question, :size => 20, :class => 'small', :accesskey => accesskey(:quick_search) %>
36:         <% end %>
37:         <%= render :partial => 'layouts/project_selector' if User.current.memberships.any? %>
38:     </div>
39:     
40:     <h1><%= h(@project && !@project.new_record? ? @project.name : Setting.app_title) %></h1>

RAILS_ROOT: C:/Program Files/redmine-0.8.5

Application Trace | Framework Trace | Full Trace
vendor/rails/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb:147:in `log'
vendor/rails/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb:302:in `execute'
vendor/rails/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb:537:in `select'
vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb:7:in `select_all_without_query_cache'
vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/query_cache.rb:59:in `select_all'
vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/query_cache.rb:80:in `cache_sql'
vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/query_cache.rb:59:in `select_all'
vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb:13:in `select_one'
vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb:19:in `select_value'
vendor/rails/activerecord/lib/active_record/calculations.rb:225:in `execute_simple_calculation'
vendor/rails/activerecord/lib/active_record/calculations.rb:126:in `calculate'
vendor/rails/activerecord/lib/active_record/calculations.rb:122:in `catch'
vendor/rails/activerecord/lib/active_record/calculations.rb:122:in `calculate'
vendor/rails/activerecord/lib/active_record/calculations.rb:48:in `count'
vendor/rails/activerecord/lib/active_record/associations/has_many_association.rb:37:in `count_records'
vendor/rails/activerecord/lib/active_record/associations/association_collection.rb:194:in `size'
vendor/rails/activerecord/lib/active_record/associations/association_collection.rb:207:in `empty?'
vendor/rails/activerecord/lib/active_record/associations/association_collection.rb:214:in `any?'
app/views/layouts/base.rhtml:37:in `_run_erb_47app47views47layouts47base46rhtml'

Request

Parameters:

None

Show session dump

Response

Headers:

{"Status"=>"200 OK",
 "cookie"=>[],
 "Cache-Control"=>"no-cache"}