Search code examples
ruby-on-railsrubydelayed-job

Can the delayed_job gem be used outside of Rails?


Is it possible to use the delayed_job gem outside of Rails? Or put another way, can it be used in a pure Ruby project?

If so, how?


Solution

  • I don't know why this person never posted this.

    It's easy. Two steps:

    http://brkrd.com/post/45269754283/delayed-job-without-rails

    UPDATE Looks like the link is broken.

    You will need Active Record, but not Rails. You will have to mock a Rails object, and load your database information, environment, and root into the Rails object so that DelayedJob thinks it's in the Rails environment.