I recently had to migrate a redmine installation which gave me the opportunity to come in contact again with ruby, Plenty of my friends and co-devops seem to really love ruby. Now here was my chance to make this a slick one. At the same time I had to do some thinking concerning how to migrate and upgrade at the same time (even the order of the 2 is debatable). I decided to install the latest and greatest to get the most out of the virtual machine in the private cloud : ruby rvm + passenger + nginx + mariadb. It turned out to be screaming fast. I think rvm is awesome. Having the ability to pin a version of ruby by not having to install new packages turned out to be a good gamble. Compiling nginx with passenger plugin also is a clear winner. The performance gain over an apache oriented install was expected but it is like 3 times as fast. switching of gzip in nginx even made it faster. But it was not all sunshine. At one point I was testing the installation. We have 6 redmine plugins/mods running that need to function as before. One of them was a project plugin giving us the ability to incorporate project logic in redmine. You can view issues ‘under’ a project.

That’s where it failed. a server 500 was trown concerning some problem in the code:

Started GET "/projects/sysadmin/issues" for 123.213.123.213 at 2014-01-17 03:55:24 +0100
Processing by IssuesController#index as HTML
  Parameters: {"project_id"=>"sysadmin"}
  Current user: glenn.plas (id=4)
  Rendered queries/_filters.html.erb (28.0ms)
  Rendered queries/_columns.html.erb (167.9ms)
  Rendered plugins/redmine_contacts_helpdesk/app/views/issues/index.html.erb within layouts/base (222.2ms)
Completed 500 Internal Server Error in 356.8ms

ActionView::Template::Error (undefined local variable or method `tag_name' for #<#<Class:0x00000007475db8>:0x00000007c83050>):
    17:     <td>
    18:       <%= label_tag "selected_columns", l(:description_selected_columns) %>
    19:       <br />
    20:       <%= select_tag tag_name,
    21:               options_for_select(query_selected_inline_columns_options(query)),
    22:               :id => 'selected_columns', :multiple => true, :size => 10, :style => "width:150px",
    23:               :ondblclick => "moveOptions(this.form.selected_columns, this.form.available_columns);" %>
  app/views/queries/_columns.html.erb:20:in `_app_views_queries__columns_html_erb___44656913496130842_63375140'
  app/controllers/issues_controller.rb:83:in `block (2 levels) in index'
  app/controllers/issues_controller.rb:82:in `index'

After some searching through the source code and the commits in the codebase of redmine on bitbucket.org , I’ve changed the following to make this work: In the file app/views/queries/_columns.html.erb

       <%= label_tag "selected_columns", l(:description_selected_columns) %>
       <br />
-      <%= select_tag tag_name,
+      <%= select_tag label_tag,
               options_for_select(query_selected_inline_columns_options(query)),
               :id => 'selected_columns', :multiple => true, :size => 10, :style => "width:150px",
               :ondblclick => "moveOptions(this.form.selected_columns, this.form.available_columns);" %>

It’s concerning the Available/Selected (hidden) options section. When I change this to label_tag it shows the column names fine. To reproduce, all you need to do is visit a link like this : /projects//issues?set_filter=1&tracker_id=4 . Substitute project names to an existing one. This wasn’t the case in redmine 2.2.

And after that the 500 error went away. Below some version numbers in case you ended up here searching for a clue on that error.

Environment:
  Redmine version                2.4.2.stable
  Ruby version                   2.1.0-p0 (2013-12-25) [x86_64-linux]
  Rails version                  3.2.16
  Environment                    production
  Database adapter               Mysql2
SCM:
  Subversion                     1.6.17
  Git                            1.7.9.5
  Filesystem                    
Redmine plugins:
  redmine_better_gantt_chart     0.9.0
  redmine_contacts               3.2.4-pro
  redmine_contacts_helpdesk      2.2.3-pro
  redmine_default_columns        0.1.1
  redmine_impasse                1.2.2
  redmine_improved_searchbox     0.0.3
  redmine_issue_checklist        2.0.6
  redmine_monitoring_controlling 0.1.1
  redmine_my_page_queries        2.0.9
  redmine_spent_time             2.5.0