Project

General

Profile

ActionView::Template::Error (undefined method `accessor' for #<ActiveModel::Type::Value:0x0481b528>)

Added by Sergey Doroshenkov about 5 years ago

I migrated the old redmine database (v. 2.2) to the new windows server and also to upgraded Redmine to the latest version (v. 4.0.1).

And now then I try to open any issues in Redmine I get the error (see attached pic). In the log file i see the following message:

Completed 500 Internal Server Error in 4570ms (ActiveRecord: 2056.9ms)

ActionView::Template::Error (undefined method `accessor' for #<ActiveModel::Type::Value:0x0481b528>):
    15: <% end %>
    16: 
    17: <% if @issue.safe_attribute? 'assigned_to_id' %>
    18: <p><%= f.select :assigned_to_id, principals_options_for_select(@issue.assignable_users, @issue.assigned_to), :include_blank => true, :required => @issue.required_attribute?('assigned_to_id') %></p>
    19: <% end %>
    20: 
    21: <% if @issue.safe_attribute?('category_id') && @issue.project.issue_categories.any? %>

How can I solve this problem? Thank you in advance!


Replies (3)

RE: ActionView::Template::Error (undefined method `accessor' for #<ActiveModel::Type::Value:0x0481b528>) - Added by kumar abhinav about 5 years ago

It looks like you are missing the migrations.
Please run the migrations with below command and try again.

For Linux:

RAILS_ENV=production bundle exec rake db:migrate

For windows:

set RAILS_ENV=production
bundle exec rake db:migrate

Let me know if you need any more help.

RE: ActionView::Template::Error (undefined method `accessor' for #<ActiveModel::Type::Value:0x0481b528>) - Added by Sergey Doroshenkov almost 5 years ago

Then I run the command:

bundle exec rake db:migrate RAILS_ENV=production

I see the following error:

Caused by:
Mysql2::Error: Field 'mail' doesn't have a default value

Can this error cause the main error with undefined method `accessor'?

    (1-3/3)