문제

I have this very simple code to run rufus/scheduler:

require 'rufus/scheduler'
require 'rubygems'

scheduler = Rufus::Scheduler.new

scheduler.every '1s' do 
puts "Hello world"

end
scheduler.join

This doesn't seem to work and I get no result.

도움이 되었습니까?

해결책

You are including the wrong gem, try this:

require 'rubygems'
require 'rufus-scheduler'

scheduler = Rufus::Scheduler.new

scheduler.every '1s' do 
puts "Hello world"

end
scheduler.join
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top