rubytzinfo

Cannot determine timezone from nil (ArgumentError)


I want to use Smashing (a sinitra-based dashboard-making tool) on a Windows machine. When lanching the the default project using smashing start I get the following error :

C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/et-orbi-1.1.2/lib/et-orbi.rb:309:in `initialize': Cannot determine timezone from nil (ArgumentError)
(secs:1531385616.656456,utc~:"2018-07-12 08:53:36.6564559936523438",ltz~:nil)
(etz:nil,tnz:"Paris, Madrid (heure d\x92\xE9t\xE9)",tzid:"constant",rv:"2.3.3",rp:"i386-mingw32",win:true,rorv:nil,astz:nil,eov:"1.1.2",eotnz:"???",eotnfz:"???",eotlzn:"???",
debian:nil,centos:nil,osx:nil)
Try setting `ENV['TZ'] = 'Continent/City'` in your script (see https://en.wikipedia.org/wiki/List_of_tz_database_time_zones)
        from C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/et-orbi-1.1.2/lib/et-orbi.rb:21:in `new'
        from C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/et-orbi-1.1.2/lib/et-orbi.rb:21:in `now'
        from C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/et-orbi-1.1.2/lib/et-orbi.rb:259:in `now'
        from C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/rufus-scheduler-3.4.2/lib/rufus/scheduler.rb:543:in `start'
        from C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/rufus-scheduler-3.4.2/lib/rufus/scheduler.rb:89:in `initialize'
        from C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/smashing-1.1.0/lib/dashing/app.rb:11:in `new'
        from C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/smashing-1.1.0/lib/dashing/app.rb:11:in `<top (required)>'
        from C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/smashing-1.1.0/lib/dashing.rb:3:in `require'
        from C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/smashing-1.1.0/lib/dashing.rb:3:in `<top (required)>'
        from config.ru:1:in `require'
        from config.ru:1:in `block in <main>'
        from C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/rack-2.0.5/lib/rack/builder.rb:55:in `instance_eval'
        from C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/rack-2.0.5/lib/rack/builder.rb:55:in `initialize'
        from config.ru:1:in `new'
        from config.ru:1:in `<main>'
        from C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/thin-1.7.2/lib/rack/adapter/loader.rb:33:in `eval'
        from C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/thin-1.7.2/lib/rack/adapter/loader.rb:33:in `load'
        from C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/thin-1.7.2/lib/thin/controllers/controller.rb:182:in `load_rackup_config'
        from C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/thin-1.7.2/lib/thin/controllers/controller.rb:72:in `start'
        from C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/thin-1.7.2/lib/thin/runner.rb:203:in `run_command'
        from C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/thin-1.7.2/lib/thin/runner.rb:159:in `run!'
        from C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/thin-1.7.2/bin/thin:6:in `<top (required)>'
        from C:/RailsInstaller/Ruby2.3.3/bin/thin:22:in `load'
        from C:/RailsInstaller/Ruby2.3.3/bin/thin:22:in `<main>'

After looking online, I found out that this issue is probably due to Windows, and I tried adding gem 'tzinfo-data' in my Gemfile, but that didn't change anything. Do you know how I could fix that ?


Solution

  • ENV['TZ'] = 'Europe/Paris' at the very beginning of config.ru (before the require) worked