Defect #18936
closed
ActionView::Template::Error (undefined method `name' for nil:NilClass) rendering issue pages after upgrade to 2.6.1 stable
Added by mathew murphy almost 10 years ago.
Updated over 9 years ago.
Description
ActionView::Template::Error (undefined method `name' for nil:NilClass):
18: <p><%= f.select :assigned_to_id, principals_options_for_select(@issue.a
ssignable_users, @issue.assigned_to), :include_blank => true, :required => @iss
ue.required_attribute?('assigned_to_id') %></p>
19: <% end %>
20:
21: <% if @issue.safe_attribute?('category_id') && @issue.project.issue_cat
egories.any? %>
22: <p><%= f.select :category_id, (@issue.project.issue_categories.collect
{|c| [c.name, c.id]}), :include_blank => true, :required => @issue.required_att
ribute?('category_id') %>
23: <%= link_to(image_tag('add.png', :style => 'vertical-align: middle;'),
24: new_project_issue_category_path(@issue.project),
app/views/issues/_attributes.html.erb:21:in `block in _app_views_issues__attr
ibutes_html_erb___1181801666658417305_70134208662720'
app/helpers/application_helper.rb:1063:in `labelled_fields_for'
app/views/issues/_attributes.html.erb:1:in `_app_views_issues__attributes_htm
l_erb___1181801666658417305_70134208662720'
app/views/issues/_form.html.erb:41:in `block in _app_views_issues__form_html_
erb__2666950825987578435_70134210527540'
app/helpers/application_helper.rb:1063:in `labelled_fields_for'
app/views/issues/_form.html.erb:1:in `_app_views_issues__form_html_erb__26669
50825987578435_70134210527540'
app/views/issues/_edit.html.erb:8:in `block in _app_views_issues__edit_html_e
rb___1994174280364428611_70134209111280'
app/helpers/application_helper.rb:1056:in `labelled_form_for'
app/views/issues/_edit.html.erb:1:in `_app_views_issues__edit_html_erb___1994
174280364428611_70134209111280'
app/views/issues/show.html.erb:132:in `_app_views_issues_show_html_erb___1732
996236595601485_70134208662260'
app/controllers/issues_controller.rb:128:in `block (2 levels) in show'
app/controllers/issues_controller.rb:125:in `show'
Environment:
Redmine version 2.6.1.stable.13933
Ruby version 2.2.0-p0 (2014-12-25) [x86_64-linux]
Rails version 3.2.21
Environment production
Database adapter PostgreSQL
SCM:
Subversion 1.8.8
Git 1.9.1
Filesystem
Redmine plugins:
no plugin installed
Also getting a similar issue with the issues page:
Started GET "/issues/" for 9.49.158.179 at 2015-01-22 16:47:21 -0600
Processing by IssuesController#index as HTML
Current user: meta@us.ibm.com (id=4)
Completed 500 Internal Server Error in 12.5ms
NoMethodError (undefined method `name' for nil:NilClass):
app/models/issue_query.rb:158:in `initialize_available_filters'
app/models/query.rb:346:in `available_filters'
app/models/query.rb:235:in `build_from_params'
app/models/issue_query.rb:119:in `build_from_params'
app/helpers/queries_helper.rb:179:in `retrieve_query'
app/controllers/issues_controller.rb:56:in `index'
NoMethodError (undefined method `name' for nil:NilClass):
app/models/custom_field.rb:49:in `block in <class:CustomField>'
app/models/issue_query.rb:255:in `available_columns'
app/models/query.rb:419:in `sortable_columns'
app/controllers/issues_controller.rb:358:in `retrieve_previous_and_next_issue_ids'
app/controllers/issues_controller.rb:127:in `block (2 levels) in show'
app/controllers/issues_controller.rb:125:in `show'
This is after editing and saving my custom field in the hope that that might fix things.
Removing the custom field from the list of columns to display on the issues page has made the issues page render again, so it's definitely something custom field related.
- Status changed from New to Needs feedback
Please use Ruby 2.1. Redmine 2.6 does not support Ruby 2.2.
Reverted to Ruby 2.1.2p95 (previous working version), did a bundle install, and things work again. Thanks.
I did look to see if there was a warning about Ruby 2.2 on the upgrade page before upgrading, but there isn't.
- Status changed from Needs feedback to Closed
- Resolution set to Invalid
mathew murphy wrote:
Reverted to Ruby 2.1.2p95 (previous working version), did a bundle install, and things work again. Thanks.
Thanks for the feedback. Closing this issue.
mathew murphy wrote:
I did look to see if there was a warning about Ruby 2.2 on the upgrade page before upgrading, but there isn't.
Indeed there isn't. But I think it boils down to RedmineUpgrade#Step-1-Check-requirements (and Continuous_integration).
Go MAEDA wrote:
Please use Ruby 2.1. Redmine 2.6 does not support Ruby 2.2.
Good catch! I totally missed it... :sigh:
mathew murphy wrote:
I did look to see if there was a warning about Ruby 2.2 on the upgrade page before upgrading, but there isn't.
I have added Ruby 2.2 note to RedmineInstall.
For those of us that hit this issue and don't think to check the docs right away, it might be helpful to have a hard exit in the boot process.
diff --git a/config/application.rb b/config/application.rb
index 58d949a..a551c04 100644
--- a/config/application.rb
+++ b/config/application.rb
@@ -9,6 +9,13 @@ if defined?(Bundler)
# Bundler.require(:default, :assets, Rails.env)
end
+current_ruby = Gem::Version.new(RUBY_VERSION)
+unsupported_ruby = Gem::Version.new("2.2")
+if current_ruby >= unsupported_ruby
+ puts "Redmine 2.6 does not support Ruby 2.2 or above. See http://www.redmine.org/projects/redmine/wiki/RedmineInstall#Ruby-interpreter for details."
+ exit 1
+end
+
module RedmineApp
class Application < Rails::Application
# Settings in config/environments/* take precedence over those specified here.
Also available in: Atom
PDF