Defect #10442

Ruby 1.9.3 Time Zone setting Internal error.

Added by Jun NAITOH over 5 years ago. Updated over 5 years ago.

Status:ClosedStart date:
Priority:NormalDue date:
Assignee:Jean-Philippe Lang% Done:

0%

Category:Ruby support
Target version:1.4.0
Resolution:Fixed Affected version:

Description

I tested on Redmine trunk r9237.

  • CentOS 6 x86
  • Ruby 1.9.3p125
  • Rails 2.3.14
  • sqlite3 1.3.5
  1. login admin
  2. select "My account"
  3. select "Time Zone : (GMT+9:00) Tokyo"
  4. click Save

Internal error

Processing MyController#account (for 192.168.56.1 at 2012-03-10 21:42:39) [GET]
  Parameters: {"controller"=>"my", "action"=>"account"}
Rendering template within layouts/base
Rendering my/account

ActionView::TemplateError (undefined method `new0' for DateTime:Class) on line #4 of app/views/my/_sidebar.html.erb:
1: <h3><%=l(:label_my_account)%></h3>
2: 
3: <p><%=l(:field_login)%>: <strong><%= link_to_user(@user, :format => :username) %></strong><br />
4: <%=l(:field_created_on)%>: <%= format_time(@user.created_on) %></p>
5: 
6: 
7: <h4><%= l(:label_feeds_access_key) %></h4>

    (eval):2:in `to_date'
    lib/redmine/i18n.rb:40:in `format_date'
    lib/redmine/i18n.rb:48:in `format_time'
    app/views/my/_sidebar.html.erb:4
    app/views/my/account.html.erb:48:in `block in _run_erb_app47views47my47account46html46erb'
    app/helpers/application_helper.rb:1045:in `content_for'
    app/views/my/account.html.erb:47
    <internal:prelude>:10:in `synchronize'
    passenger (3.0.11) lib/phusion_passenger/rack/request_handler.rb:96:in `process_request'
    passenger (3.0.11) lib/phusion_passenger/abstract_request_handler.rb:513:in `accept_and_process_next_request'
    passenger (3.0.11) lib/phusion_passenger/abstract_request_handler.rb:274:in `main_loop'
    passenger (3.0.11) lib/phusion_passenger/classic_rails/application_spawner.rb:321:in `start_request_handler'
    passenger (3.0.11) lib/phusion_passenger/classic_rails/application_spawner.rb:275:in `block in handle_spawn_application'
    passenger (3.0.11) lib/phusion_passenger/utils.rb:479:in `safe_fork'
    passenger (3.0.11) lib/phusion_passenger/classic_rails/application_spawner.rb:270:in `handle_spawn_application'
    passenger (3.0.11) lib/phusion_passenger/abstract_server.rb:357:in `server_main_loop'
    passenger (3.0.11) lib/phusion_passenger/abstract_server.rb:206:in `start_synchronously'
    passenger (3.0.11) lib/phusion_passenger/abstract_server.rb:180:in `start'
    passenger (3.0.11) lib/phusion_passenger/classic_rails/application_spawner.rb:149:in `start'
    passenger (3.0.11) lib/phusion_passenger/spawn_manager.rb:219:in `block (2 levels) in spawn_rails_application'
    passenger (3.0.11) lib/phusion_passenger/abstract_server_collection.rb:132:in `lookup_or_add'
    passenger (3.0.11) lib/phusion_passenger/spawn_manager.rb:214:in `block in spawn_rails_application'
    passenger (3.0.11) lib/phusion_passenger/abstract_server_collection.rb:82:in `block in synchronize'
    <internal:prelude>:10:in `synchronize'
    passenger (3.0.11) lib/phusion_passenger/abstract_server_collection.rb:79:in `synchronize'
    passenger (3.0.11) lib/phusion_passenger/spawn_manager.rb:213:in `spawn_rails_application'
    passenger (3.0.11) lib/phusion_passenger/spawn_manager.rb:132:in `spawn_application'
    passenger (3.0.11) lib/phusion_passenger/spawn_manager.rb:275:in `handle_spawn_application'
    passenger (3.0.11) lib/phusion_passenger/abstract_server.rb:357:in `server_main_loop'
    passenger (3.0.11) lib/phusion_passenger/abstract_server.rb:206:in `start_synchronously'
    passenger (3.0.11) helper-scripts/passenger-spawn-server:99:in `<main>'

Rendering /opt/Redmine/redmine.d/trunk/public/500.html (500 Internal Server Error)

Associated revisions

Revision 9244
Added by Jean-Philippe Lang over 5 years ago

Fixed: ruby 1.9.3 Time Zone setting Internal error (#10442).

History

#1 Updated by Etienne Massip over 5 years ago

  • Category set to Ruby support
  • Status changed from New to Confirmed
  • Target version set to 1.4.0

#3 Updated by Jun NAITOH over 5 years ago

I tried Ruby 1.9.2 now. But Ruby 1.9.2 don't reproduce this problem.
I think Ruby 1.9.3 only problem, too.

#4 Updated by Etienne Massip over 5 years ago

Adding gem 'tzinfo' to the Gemfile did the trick for me.

#5 Updated by Jun NAITOH over 5 years ago

Etienne Massip wrote:

Adding gem 'tzinfo' to the Gemfile did the trick for me.

Me too. I added to Gemfile as follows.

--- Gemfile    (revision 9237)
+++ Gemfile    (working copy)
@@ -4,6 +4,7 @@
 gem "i18n", "~> 0.4.2" 
 gem "coderay", "~> 1.0.0" 
 gem "fastercsv", "~> 1.5.0", :platforms => [:mri_18, :mingw_18, :jruby]
+gem "tzinfo", "~> 0.3.31" 

 # Optional gem for LDAP authentication
 group :ldap do

I think this problem was fixed by this setting.

#6 Updated by Jean-Philippe Lang over 5 years ago

  • Status changed from Confirmed to Closed
  • Assignee set to Jean-Philippe Lang
  • Resolution set to Fixed

Fixed in r9244. Thanks.

Also available in: Atom PDF