Am 20.02.2014 17:28, schrieb cynic limbu:
> I use random codes just to give an example of what I'm talking about.

But your example had nothing to do with daemons at all.

> On the other hand, What I meant to ask is how do you use daemon to run a 
> ruby script in the background
> 
> The following example didn't work for me
> 
> ruby myserver_control.rb start
> 
> I get:
> C:/Ruby200/lib/ruby/gems/2.0.0/gems/daemons-1.1.9/lib/daemons/daemonize.rb:11:in
>  `fork': fork() function is unimplemented on this machine 
> (NotImplementedError)

Good, an error message is much more useful to us.

This is specific to Windows which does not provide forks, I fear
I cannot help. You need to find out whether the daemons gem even
can be used on Windows or not, probably the docs can help.

There is an entire Ruby Rogues episode on daemons, you might find
some useful information there:

  http://rubyrogues.com/122-rr-daemons-with-kenneth-kalmer/

Regards,
Marcus


-- 
GitHub: https://github.com/stomar/
PGP:    0x6B3A101A