Cannot determine timezone from #<ActiveSupport::TimeZone:0x00007fceb83747c0 @name="Eastern Time (US & Canada)", @utc_offset=nil, @tzinfo=#<TZInfo::DataTimezone: America/New_York>> (ArgumentError)
Closed this issue · 8 comments
I am running MacOS High Sierra. I am also running ruby 2.5.0-preview1 and rails 5.1.4.
When I try to run my dashing dashboard server, which relies on rufus-scheduler, I am getting this:
bin/rails: Cannot determine timezone from #<ActiveSupport::TimeZone:0x00007fceb83747c0 @name="Eastern Time (US & Canada)", @utc_offset=nil, @tzinfo=#<TZInfo::DataTimezone: America/New_York>> (ArgumentError)
(secs:1508818944.558708,utc~:"0047-10-24 04:22:24.5587079524993896",ltz~:"LMT")
(etz:"America/New_York",tnz:"EDT",tzid:"constant",rv:"2.5.0",rp:"x86_64-darwin17",eov:"1.0.7",rorv:"5.1.4",astz:[ActiveSupport::TimeZone, "America/New_York"],
debian:nil,centos:nil,osx:"zoneinfo/America/New_York")
Try setting ENV['TZ'] = 'Continent/City'
in your script (see https://en.wikipedia.org/wiki/List_of_tz_database_time_zones)
I have run your test.rb problem shared with other people in similar problem threads:
require 'rufus-scheduler'
ENV['TZ'] = 'America/New_York'
scheduler = Rufus::Scheduler.new
scheduler.in '2s' do
puts Time.now
puts 'Hello...World'
end
#scheduler.join
sleep 3
And the result I get is:
bundle exec ruby test.rb
2017-10-24 00:56:35 -0400
Hello...World
So your test program runs fine.
In my zsh environment, I have:
echo $TZ
America/New_York
I added this to my config/application.rb file:
require 'rufus-scheduler'
ENV['TZ'] = 'America/New_York'
And I have also tried adding:
config.time_zone = 'Eastern Time (US & Canada)'
If I run "bin/rails test", I get:
/Users/mileslane/.rvm/gems/ruby-2.5.0-preview1/gems/et-orbi-1.0.7/lib/et-orbi.rb:304:in initialize': Cannot determine timezone from #<ActiveSupport::TimeZone:0x00007fa61660d998 @name="UTC", @utc_offset=nil, @tzinfo=#<TZInfo::DataTimezone: Etc/UTC>> (ArgumentError) (secs:1508820110.942185,utc~:"0047-10-24 04:41:50.9421849250793457",ltz~:"LMT") (etz:"America/New_York",tnz:"EDT",tzid:"constant",rv:"2.5.0",rp:"x86_64-darwin17",eov:"1.0.7",rorv:"5.1.4",astz:[ActiveSupport::TimeZone, "Etc/UTC"], debian:nil,centos:nil,osx:"zoneinfo/America/New_York") Try setting
ENV['TZ'] = 'Continent/City'` in your script (see https://en.wikipedia.org/wiki/List_of_tz_database_time_zones)
Sorry to trouble you.
By the way, I have installed all the latest updates from Apple for MacOS 10.13 High Sierra, including the latest XCode command line tools. I have also the latest updates from "brew update" and "brew upgrade".
I am suspicious about this part of the error message: osx:"zoneinfo/America/New_York"
Also, "sudo systemsetup -gettimezone"
gives:
Time Zone: America/New_York
Hello, no troubling at all, thanks for the detailed reporting.
@mileslane Hello, may I have the full stack trace for the 2 errors you are reporting? Thanks in advance.
@mileslane Hello, forget about the stack traces. Could you please upgrade your et-orbi to 1.0.8 and try again, then tell me if the issue is gone or if it takes another form.
Thanks in advance.
Thanks.
After upgrading et-orbi to 1.0.8:
=> Booting Puma
=> Rails 5.1.4 application starting in development
=> Runrails server -h
for more startup options
Exiting
Traceback (most recent call last):
bin/rails: Cannot determine timezone from #<ActiveSupport::TimeZone:0x00007f8778fc7db0 @name="America/New_York", @utc_offset=nil, @tzinfo=#<TZInfo::DataTimezone: America/New_York>> (ArgumentError)
(secs:1508853206.1556401,utc~:"0047-10-24 13:53:26.1556401252746582",ltz~:"LMT")
(etz:"America/New_York",tnz:"EDT",tzid:"constant",rv:"2.5.0",rp:"x86_64-darwin17",eov:"1.0.7",rorv:"5.1.4",astz:[ActiveSupport::TimeZone, "America/New_York"],
debian:nil,centos:nil,osx:"zoneinfo/America/New_York")
Try settingENV['TZ'] = 'Continent/City'
in your script (see https://en.wikipedia.org/wiki/List_of_tz_database_time_zones)
Strange. I suspect that this part of the error message is saying that et-orbi 1.0.7 is still being used?
eov:"1.0.7"
'gem list'
shows:
et-orbi (1.0.8, 1.0.7)
Got it! Thanks!
I had to explicitly remove et-orbi 1.0.7 from my Gemfile.lock.
Cheers!
You're welcome!