Make a Ruby program a daemon?

agentbanks217 picture agentbanks217 · Sep 10, 2010 · Viewed 21.8k times · Source

I want to write a Ruby program that will always be running in the background (a daemon) on my Mac.

Can someone point me in the right direction on how this would be done?

Answer

Hertzel Guinness picture Hertzel Guinness · May 19, 2012

Ruby 1.9.x has now the following:

Process.daemon

Put it in your code and that's it.

Taken from "Daemon Processes in Ruby."