Rufus Scheduler not working

I want to do something simple with gem rufus-scheduler: https://github.com/jmettraux/rufus-scheduler

but I can't get it to work.

I have a regular rails app. I created a .rb file:

# test_rufus_scheduler.rb
require 'rubygems'
require 'rufus/scheduler'

scheduler = Rufus::Scheduler.start_new

scheduler.in '1s' do
  puts "hello world"
end

Then when I try ruby ​​test_rufus_scheduler.rb nothing happens. Am I doing it right? gem shows rufus-scheduler.

Thank.

+1
source share
3 answers

If your script exits right away, try adding

scheduler.join

in the end. Please note that when you run the script separately and through the rails, it is different. See README for details .

+2
source

( Ajet's ).

. - Ruby. Rufus , . /Nginx nginx.conf , :.

nginx.conf:

passenger_spawn_method direct;
passenger_min_instances 1;
passenger_pool_idle_time 0;
+2

Add the lines below to apache2 configuration and restart apache2 server

RailsAppSpawnerIdleTime 0
PassengerMinInstances 1
+1
source

All Articles