From: Jano Svitok Date: 2007-12-12T20:22:27+09:00 Subject: Re: 1053 Error about win32-service On Dec 12, 2007 4:51 AM, Kai Geng wrote: > Hi > I have installed the gem of win32-service-0.6.0-x86-mswin32-60.gem.But > when I run my test code such as: > > require 'rubygems' > require 'win32/service' > include Win32 > > s = Service.new > s.create_service{ |srv| > srv.service_name = "foo" > srv.binary_path_name = "D:\\Ruby\\bin\\ruby "+File.expand_path($0) > srv.display_name = "Test_service" > } > s.close > > Service.start("foo") > > I will get a 1053 ERROR. How can I rescue the error? I suggest you google for "1053 ERROR win32-service ruby". You may start the service from the command line (net start foo) to see if you get an additional debug info. Then, try running your service in standalone mode (i.e. just run "D:\\Ruby\\bin\\ruby "+File.expand_path($0)) The error you get might be dependant on OS version (XP/2K3/vista) and the user it runs under (default is SYSTEM). There are several constraints what you can and cannot do when running as service. Most notably, you won't have access to stdin/stdout/stderr, and to any substed/mapped/network disks. The PATH might be different as well.