Hey everyone,
I have a very (hopefully) dumb question about running daemons with the
daemons gem. This is my set up (using strictly the code from the daemons
API page):
myserver.rb
loop do
sleep(5)
end
myserver_control.rb
require ‘rubygems’
require ‘daemons’
Daemons.run(‘myserver.rb’)
THEN I typed this into the console:
ruby script/runner myserver.rb
and THIS is the ERROR I got:
F:\InstantRails\rails_apps\vote>ruby script/runner myserver.rb
F:/InstantRails/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/runner.rb:4
7: undefined local variable or method myserver' for main:Object (NameError) from F:/InstantRails/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require .rb:27:in
eval’
from
F:/InstantRails/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/command
s/runner.rb:47
from
F:/InstantRails/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require
.rb:27:in gem_original_require' from F:/InstantRails/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require .rb:27:in
require’
from script/runner:3
Dumb question 1: What am I doing wrong?
Dumb question 2: These files are supposed to be in the root of the tasks
folder correct?
Thanks in advance,
Brandon