Prob with daemon

i am struggling with this daemon gem and cannot get it to work. any
help is appreciated.

E:\TradingTools\Development\app\helpers>ruby myserver_control.rb start
e:/ruby/lib/ruby/gems/1.8/gems/daemons-1.0.9/lib/daemons/daemonize.rb:
103:in `fork': the fork() function is unimplemente
d on this machine (NotImplementedError)
        from e:/ruby/lib/ruby/gems/1.8/gems/daemons-1.0.9/lib/daemons/
daemonize.rb:103:in `safefork'
        from e:/ruby/lib/ruby/gems/1.8/gems/daemons-1.0.9/lib/daemons/
daemonize.rb:203:in `daemonize'
        from e:/ruby/lib/ruby/gems/1.8/gems/daemons-1.0.9/lib/daemons/
application.rb:115:in `start_load'
        from e:/ruby/lib/ruby/gems/1.8/gems/daemons-1.0.9/lib/daemons/
application.rb:236:in `start'
        from e:/ruby/lib/ruby/gems/1.8/gems/daemons-1.0.9/lib/daemons/
controller.rb:69:in `run'
        from e:/ruby/lib/ruby/gems/1.8/gems/daemons-1.0.9/lib/
daemons.rb:136:in `run'
        from e:/ruby/lib/ruby/gems/1.8/gems/daemons-1.0.9/lib/daemons/
cmdline.rb:105:in `call'
        from e:/ruby/lib/ruby/gems/1.8/gems/daemons-1.0.9/lib/daemons/
cmdline.rb:105:in `catch_exceptions'
        from e:/ruby/lib/ruby/gems/1.8/gems/daemons-1.0.9/lib/
daemons.rb:135:in `run'
        from myserver_control.rb:6

  # this is myserver_control.rb

  require 'rubygems' # if you use RubyGems
  require 'daemons'

  Daemons.run('myserver.rb')

  # this is myserver.rb
  # it does nothing really useful at the moment

  loop do
    sleep(5)
  end

I see you are on windows - as the error message says, the fork is not
implemented there.
These are you options (maybe more):
1. use fork from the win32-process gem. see
http://rubyforge.org/docman/view.php/85/707/README.html for caveats
2. remove the fork call from the daemons lib code
3. reuse code from mongrel_service and/or win32-service gems

···

On Sun, Mar 2, 2008 at 5:39 PM, Junkone <junkone1@gmail.com> wrote:

i am struggling with this daemon gem and cannot get it to work. any
help is appreciated.

E:\TradingTools\Development\app\helpers>ruby myserver_control.rb start
e:/ruby/lib/ruby/gems/1.8/gems/daemons-1.0.9/lib/daemons/daemonize.rb:
103:in `fork': the fork() function is unimplemente
d on this machine (NotImplementedError)
        from e:/ruby/lib/ruby/gems/1.8/gems/daemons-1.0.9/lib/daemons/
daemonize.rb:103:in `safefork'
        from e:/ruby/lib/ruby/gems/1.8/gems/daemons-1.0.9/lib/daemons/
daemonize.rb:203:in `daemonize'
        from e:/ruby/lib/ruby/gems/1.8/gems/daemons-1.0.9/lib/daemons/
application.rb:115:in `start_load'
        from e:/ruby/lib/ruby/gems/1.8/gems/daemons-1.0.9/lib/daemons/
application.rb:236:in `start'
        from e:/ruby/lib/ruby/gems/1.8/gems/daemons-1.0.9/lib/daemons/
controller.rb:69:in `run'
        from e:/ruby/lib/ruby/gems/1.8/gems/daemons-1.0.9/lib/
daemons.rb:136:in `run'
        from e:/ruby/lib/ruby/gems/1.8/gems/daemons-1.0.9/lib/daemons/
cmdline.rb:105:in `call'
        from e:/ruby/lib/ruby/gems/1.8/gems/daemons-1.0.9/lib/daemons/
cmdline.rb:105:in `catch_exceptions'
        from e:/ruby/lib/ruby/gems/1.8/gems/daemons-1.0.9/lib/
daemons.rb:135:in `run'
        from myserver_control.rb:6

  # this is myserver_control.rb

  require 'rubygems' # if you use RubyGems
  require 'daemons'

  Daemons.run('myserver.rb')

  # this is myserver.rb
  # it does nothing really useful at the moment

  loop do
    sleep(5)
  end

4. use cygwin's Ruby.

  robert

···

On 02.03.2008 20:56, Jano Svitok wrote:

On Sun, Mar 2, 2008 at 5:39 PM, Junkone <junkone1@gmail.com> wrote:

i am struggling with this daemon gem and cannot get it to work. any
help is appreciated.

E:\TradingTools\Development\app\helpers>ruby myserver_control.rb start
e:/ruby/lib/ruby/gems/1.8/gems/daemons-1.0.9/lib/daemons/daemonize.rb:
103:in `fork': the fork() function is unimplemente
d on this machine (NotImplementedError)
        from e:/ruby/lib/ruby/gems/1.8/gems/daemons-1.0.9/lib/daemons/
daemonize.rb:103:in `safefork'
        from e:/ruby/lib/ruby/gems/1.8/gems/daemons-1.0.9/lib/daemons/
daemonize.rb:203:in `daemonize'
        from e:/ruby/lib/ruby/gems/1.8/gems/daemons-1.0.9/lib/daemons/
application.rb:115:in `start_load'
        from e:/ruby/lib/ruby/gems/1.8/gems/daemons-1.0.9/lib/daemons/
application.rb:236:in `start'
        from e:/ruby/lib/ruby/gems/1.8/gems/daemons-1.0.9/lib/daemons/
controller.rb:69:in `run'
        from e:/ruby/lib/ruby/gems/1.8/gems/daemons-1.0.9/lib/
daemons.rb:136:in `run'
        from e:/ruby/lib/ruby/gems/1.8/gems/daemons-1.0.9/lib/daemons/
cmdline.rb:105:in `call'
        from e:/ruby/lib/ruby/gems/1.8/gems/daemons-1.0.9/lib/daemons/
cmdline.rb:105:in `catch_exceptions'
        from e:/ruby/lib/ruby/gems/1.8/gems/daemons-1.0.9/lib/
daemons.rb:135:in `run'
        from myserver_control.rb:6

  # this is myserver_control.rb

  require 'rubygems' # if you use RubyGems
  require 'daemons'

  Daemons.run('myserver.rb')

  # this is myserver.rb
  # it does nothing really useful at the moment

  loop do
    sleep(5)
  end

I see you are on windows - as the error message says, the fork is not
implemented there.
These are you options (maybe more):
1. use fork from the win32-process gem. see
http://rubyforge.org/docman/view.php/85/707/README.html for caveats
2. remove the fork call from the daemons lib code
3. reuse code from mongrel_service and/or win32-service gems