The below error is another error related to upgrading Redmine. I imagine part of the reason I had a lot of errors is because I hadn’t upgraded this installation of Redmine, which we really just use for development, for a long time. In fact the upgrade took this installation of Redmine from 0.8.3 to Redmine 0.9.3. After I completed all of the steps in the Redmine upgrade I attempted to bring up the Redmine site in my Chrome browser but I received a 500 error from the LiteSpeed web server. The resolution was easy and is displayed below along with more details regarding the error.
Error In Redmine Project Production Log After Redmine Upgrade:
- Processing WelcomeController#index (for 192.168.1.35 at 2010-03-30 17:02:55) [GET]
- Parameters: {"action"=>"index", "controller"=>"welcome"}
- Rendering template within layouts/base
- Rendering welcome/index
- ActionView::TemplateError (comparison of Fixnum with nil failed) on line #38 of app/views/layouts/base.rhtml:
- 35: <%= link_to l(:label_search), {:controller => 'search', :action => 'index', :id => @project}, :accesskey => accesskey(:search) %>:
- 36: <%= text_field_tag 'q', @question, :size => 20, :class => 'small', :accesskey => accesskey(:quick_search) %>
- 37: <% end %>
- 38: <%= render_project_jump_box %>
- 39: </div>
- 40:
- 41: <h1><%= page_header_title %></h1>
- app/helpers/application_helper.rb:218:in `sort_by'
- app/helpers/application_helper.rb:218:in `project_tree'
- app/helpers/application_helper.rb:206:in `project_tree_options_for_select'
- app/helpers/application_helper.rb:196:in `render_project_jump_box'
- app/views/layouts/base.rhtml:38:in `_run_rhtml_app47views47layouts47base46rhtml'
- /var/lsws/fcgi-bin/RailsRunner.rb:61
- Rendering /home/web/devredmine/public/500.html (500 Internal Server Error)
As you can see in the above log snipet the error is a TemplateError. If you receive a similar error in your Redmine ruby project production log or development log then attempt the below fix. The below command will attempt to rerun migrations that may have failed and possibly fill in missing database fields or other data.
Redmine Project Rebuild In Production Mode:
- [web@dev devredmine]$ ruby script/runner 'Project.rebuild!' -e production
- [web@dev devredmine]$
There will not be any output when the above command is issued however that doesn’t mean that things were not repaired or rebuilt. After running the above command make sure to restart your application server (mongrel, thin, passenger, etc.).