-
Notifications
You must be signed in to change notification settings - Fork 202
Closed
Description
I ran into the "Cannot determine timezone from nil" error and wanted to post my solution. It involves setting the ENV['TZ']
variable, as you suggested, but I don't like to hardcode values like this, especially if your time zone changes from development to production environments. You can let Ruby get the time zone more explicitly.
ENV['TZ'] = Time.zone.name
scheduler = Rufus::Scheduler.new
scheduler.every '2s' do
puts "#{Time.now} Hello #{ENV['TZ']}!"
end
Metadata
Metadata
Assignees
Labels
No labels