# Problems with no method error with rufus scheduler

**URL:** <https://www.ruby-forum.com/t/problems-with-no-method-error-with-rufus-scheduler/186492>\
**Category:** Rails\
**Created:** [April 7, 2010, 11:18pm UTC](https://www.ruby-forum.com/t/problems-with-no-method-error-with-rufus-scheduler/186492 "2010-04-07T23:18:37Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![skroll](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/f0a364/32.png) [@skroll](https://www.ruby-forum.com/u/skroll)\
**Post date:** [April 7, 2010, 11:18pm UTC](https://www.ruby-forum.com/t/problems-with-no-method-error-with-rufus-scheduler/186492/1 "2010-04-07T23:18:37Z")

</div>

Hi,

I have a problem with rufus. I created a test.rb file in the /config/  
initializers folder.

test.rb

require ‘rubygems’  
require ‘rufus/scheduler’

scheduler = Rufus::Scheduler.start\_new

scheduler.each ‘10s’ do  
puts “hey see you in 10seconds!”  
end

works fine so far.  
Now I change it to:

test.rb

require ‘rubygems’  
require ‘rufus/scheduler’

scheduler = Rufus::Scheduler.start\_new

scheduler.each ‘10s’ do  
recipe = Recipe.check\_for\_new\_print\_jobs  
end

And here I get an error… etc. method check\_for\_new\_print\_jobs not  
found.

The method is in the recipe controller

/app/controllers/recipe\_controller.rb

class RecipeController \< ApplicationController

def index  
end

def show  
end

def check\_for\_new\_print\_jobs  
File.open(‘test\_scheduler’, ‘a’) do |f1|  
f1 \<\< “Hey, I am still alive” + Time.now.to\_s+ “\n”  
end  
end

ruby -v  
ruby 1.8.6

rails -v  
rails 2.3.5

Can anyone give me a hint? Is there something special to do, because I  
am calling a method out of a initializer file?  
Thank you very much.
