2008-06-04

Getting the load path right for Windows

I used a startup for my daemon like this

c:\bin\ruby\rubyw.exe c:\mydir\mydaemon.rb


However it didn't work as the default load path was not set up correctly and so it couldn't find the library files however this does work:

c:\bin\ruby\rubyw.exe -C c:\mydir mydaemon.rb

The -C option changing the working directory and so I could get my Ruby service running quietly in the background.

I will leave for another day the problem of getting spaces in the directory path - for the moment I just used a path without spaces.

No comments: