Running rake task from a daemon

1.2k views Asked by At

I have a daemon that i made using the daemons gem

I run it and it just closes without error, but the script doesn't seem to be actually running. I'm running a rake task from it, will daemons run the commands inside from the directory it was called from?

This is the script

require 'rubygems'
require 'daemons'

Daemons.run('rake mytask')

the rake task has a loop which should stop it from exiting.

1

There are 1 answers

0
Ben Miller On

I'm not sure the way you're doing this will work with daemons. Can you move the rake task into an .rb file? Daemons is going to pass what ever you have in the run command to ruby, so in essence it is trying to run "ruby rake mytask"