Redmine internal error
I get an internal error trying to access "My account" in Redmine. But after reloading the page there is no internal error and I can access the page. Here is the information from Redmine log:
Processing MyController#account (for 91.90.15.48 at 2011-09-26 01:10:20) [GET] Parameters: {"action"=>"account", "controller"=>"my"} Rendering template within layouts/base Rendering my/account
ActionView::TemplateError (uninitialized constant ActiveSupport::TimeZone::TZInfo) on line #3 of app/views/users/_preferences.html.erb: 1: <% fields_for :pref, @user.pref, :builder => TabularFormBuilder, :lang => current_language do |pref_fields| %> 2:
<%= pref_fields.check_box :hide_mail %>
3:<%= pref_fields.select :time_zone, ActiveSupport::TimeZone.all.collect {|z| [ z.to_s, z.name ]}, :include_blank => true %>
4:<%= pref_fields.select :comments_sorting, [[l(:label_chronological_order), 'asc'], [l(:label_reverse_chronological_order), 'desc']] %>
5:<%= pref_fields.check_box :warn_on_leaving_unsaved %>
6: <% end %>app/views/users/_preferences.html.erb:3 app/views/users/_preferences.html.erb:1 app/views/my/account.rhtml:40:in
_run_rhtml_app47views47my47account46rhtml' app/views/my/account.rhtml:8:in
_run_rhtml_app47views47my47account46rhtml' pas开发者_如何学编程senger (2.2.15) lib/phusion_passenger/rack/request_handler.rb:92:inprocess_request' passenger (2.2.15) lib/phusion_passenger/abstract_request_handler.rb:207:in
main_loop' passenger (2.2.15) lib/phusion_passenger/railz/application_spawner.rb:441:instart_request_handler' passenger (2.2.15) lib/phusion_passenger/railz/application_spawner.rb:381:in
handle_spawn_application' passenger (2.2.15) lib/phusion_passenger/utils.rb:252:insafe_fork' passenger (2.2.15) lib/phusion_passenger/railz/application_spawner.rb:377:in
handle_spawn_application' passenger (2.2.15) lib/phusion_passenger/abstract_server.rb:352:in__send__' passenger (2.2.15) lib/phusion_passenger/abstract_server.rb:352:in
main_loop' passenger (2.2.15) lib/phusion_passenger/abstract_server.rb:196:instart_synchronously' passenger (2.2.15) lib/phusion_passenger/abstract_server.rb:163:in
start' passenger (2.2.15) lib/phusion_passenger/railz/application_spawner.rb:222:instart' passenger (2.2.15) lib/phusion_passenger/railz/framework_spawner.rb:291:in
handle_spawn_application' passenger (2.2.15) lib/phusion_passenger/abstract_server_collection.rb:126:inlookup_or_add' passenger (2.2.15) lib/phusion_passenger/railz/framework_spawner.rb:286:in
handle_spawn_application' passenger (2.2.15) lib/phusion_passenger/abstract_server_collection.rb:80:insynchronize' passenger (2.2.15) lib/phusion_passenger/abstract_server_collection.rb:79:in
synchronize' passenger (2.2.15) lib/phusion_passenger/railz/framework_spawner.rb:284:inhandle_spawn_application' passenger (2.2.15) lib/phusion_passenger/abstract_server.rb:352:in
send' passenger (2.2.15) lib/phusion_passenger/abstract_server.rb:352:inmain_loop' passenger (2.2.15) lib/phusion_passenger/abstract_server.rb:196:in
start_synchronously' passenger (2.2.15) lib/phusion_passenger/abstract_server.rb:163:instart' passenger (2.2.15) lib/phusion_passenger/railz/framework_spawner.rb:101:in
start' passenger (2.2.15) lib/phusion_passenger/spawn_manager.rb:253:inspawn_rails_application' passenger (2.2.15) lib/phusion_passenger/abstract_server_collection.rb:126:in
lookup_or_add' passenger (2.2.15) lib/phusion_passenger/spawn_manager.rb:247:inspawn_rails_application' passenger (2.2.15) lib/phusion_passenger/abstract_server_collection.rb:80:in
synchronize' passenger (2.2.15) lib/phusion_passenger/abstract_server_collection.rb:79:insynchronize' passenger (2.2.15) lib/phusion_passenger/spawn_manager.rb:246:in
spawn_rails_application' passenger (2.2.15) lib/phusion_passenger/spawn_manager.rb:145:inspawn_application' passenger (2.2.15) lib/phusion_passenger/spawn_manager.rb:278:in
handle_spawn_application' passenger (2.2.15) lib/phusion_passenger/abstract_server.rb:352:in__send__' passenger (2.2.15) lib/phusion_passenger/abstract_server.rb:352:in
main_loop' passenger (2.2.15) lib/phusion_passenger/abstract_server.rb:196:in `start_synchronously'Rendering /home/eosweb/rails_apps/Redmine/public/500.html (500 Internal Server Error)
Processing TimeTrackersController#render_menu (for 95.81.29.50 at 2011-09-26 01:10:26) [POST] Parameters: {"action"=>"render_menu", "authenticity_token"=>"Shjxnqzbk2l3hFzHQIAoibBQLfgKwmOnC5p0XMh4P/g=", "controller"=>"time_trackers"} Completed in 14ms (View: 10, DB: 1) | 200 OK [http://redmine.eos-soft.com/time_trackers/render_menu]
Processing MyController#account (for 91.90.15.48 at 2011-09-26 01:10:32) [GET] Parameters: {"action"=>"account", "controller"=>"my"} Rendering template within layouts/base Rendering my/account Completed in 49ms (View: 46, DB: 0) | 200 OK [http://redmine.eos-soft.com/my/account]
What can be wrong?
Since Redmine does not use Bundler, it's easy for new or updated gems that get installed on the system to cause errors like this. I got the same error and solved it by putting Redmine on Bundler. Bundler keeps gems that are installed but not in the Gemfile from inadvertently being included in the Rails app.
Assuming the new gems that were installed were put there intentionally, you'll want to use bundler to keep Redmine from loading them. If that's not the case, maybe you should just see if the tzinfo gem got installed and uninstall it.
To use bundler, first install the bundler gem
gem install bundler
Then follow the instructions at http://gembundler.com/rails23.html
You can look at https://github.com/SciMed/redmine/commit/e94b607b3d9843085c178057702199a819d3725a as an example of the changes you'll to the Redmine app for bundler.
Be sure to include rails and whatever database adapter you're using in your gemfile (in my case, pg for postgresql).
Restart your app, and this issue should go away.
精彩评论