rufus-scheduler: cannot determine timezone from nil (ArgumentError)
hello, everyone
I have a problem, i’m in china , when i use rufus-scheduler
require 'rufus-scheduler'
scheduler = Rufus::Scheduler.new
scheduler.in '2s' do
puts Time.now
puts 'Hello...Word'
end
scheduler.join
get a error messge:
C:/Ruby22/lib/ruby/gems/2.2.0/gems/rufus-scheduler-3.3.0/lib/rufus/scheduler/zotime.rb:41:in `initialize': cannot determine timezone from nil (ArgumentError)
from C:/Ruby22/lib/ruby/gems/2.2.0/gems/rufus-scheduler-3.3.0/lib/rufus/scheduler/zotime.rb:196:in `new'
from C:/Ruby22/lib/ruby/gems/2.2.0/gems/rufus-scheduler-3.3.0/lib/rufus/scheduler/zotime.rb:196:in `now'
from C:/Ruby22/lib/ruby/gems/2.2.0/gems/rufus-scheduler-3.3.0/lib/rufus/scheduler.rb:561:in `start'
from C:/Ruby22/lib/ruby/gems/2.2.0/gems/rufus-scheduler-3.3.0/lib/rufus/scheduler.rb:109:in `initialize'
from 2.rb:16:in `new'
from 2.rb:16:in `<main>'
my Time.now.zone is “中国标准时间” , it means ‘China Standard Time’.
may someone help me to Solve it ? thank you very much. ps: my english is not good ,sorry about that.
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Comments: 28 (16 by maintainers)
Commits related to this issue
- Fall back on ENV['TZ'] when unknown Time.now.zone gh-222 — committed to jmettraux/rufus-scheduler by jmettraux 8 years ago
- Add spec for gh-222 — committed to jmettraux/rufus-scheduler by jmettraux 8 years ago
- Enhance gh-222 error message For example: ``` /Users/jmettraux/w/rufus-scheduler/lib/rufus/scheduler/zotime.rb:41: in `initialize': cannot determine timezone from nil (etz:nil,tnz:"中国标准时间... — committed to jmettraux/rufus-scheduler by jmettraux 8 years ago
- Document resolution tips for gh-222 — committed to jmettraux/rufus-scheduler by jmettraux 8 years ago
- Fix faq link to gh-222 resolution tips [ci skip] — committed to jmettraux/rufus-scheduler by jmettraux 8 years ago
- Prevent gh-222 test from leaking its zone — committed to jmettraux/rufus-scheduler by jmettraux 8 years ago
OK, thanks a lot. I will release a 3.3.1 with the fix and state in the documentation that setting
ENV['TZ']
might be necessary ifcannot determine timezone from nil (ArgumentError)
appears.Quick question:
Does it work for you?
It’s 6am and I’m having a coffee and contemplating and old issue getting hijacked.
.
@sofiabravo103 good morning, could you please open a new issue? If you think this new issue is related to the old, closed, issue here, please include a link to here and indicate why you think they are related.
In the new issue, please indicate on what operating system you are running. Please also indicate if you have the tzinfo-data gem included in your bundle (does it appear in your
Gemfile.lock
?).Thanks in advance.