I am trying to create a windows service with Ruby. I have successfully
created the service ( I can open up the services and see the service I
created ) but when I try to start it I get the error message:
“Could not start A Ruby Service(the name I
gave it) on Local Computer.
Error 1053: The service did not respond
to the start or control request in a timely fashion”
I have the executable of the service pointed to the full path of “ruby
c:\service.rb” and the contents of service.rb are:
require ‘win32/daemon’
include Win32
class Daemon
def service_main()
while running?
sleep 3
File.open(“c:\test.log”, “a”) { |f| f.puts “service is running”}
end
end
def service_stop
exit!
end
end
Daemon.mainloop
any ideas what I’m doing wrong?!!!