prob with daemon

J

Junkone

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
 
J

Jano Svitok

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,013
Latest member
KatriceSwa

Latest Threads

Top