Search code examples
ruby-on-railsherokudelayed-job

workless is not working (it is not starting a Heroku worker dyno)


I have the following in the Gemfile of a Rails project, yet workless (https://github.com/lostboy/workless) is not working (it is not starting a Heroku worker dyno when a job is added to the Delayed::Job queue).

gem 'delayed_job_active_record'
gem 'workless'
gem 'daemons'

Solution

  • Unfortunately this is a silent error, so I just ended up figuring it out after quite some time.

    As per the gem's instructions: Add your Heroku app name / API key as config vars to your Heroku instance.

    heroku config:add HEROKU_API_KEY=yourapikey APP_NAME=yourherokuappname
    

    Get yourapikey from https://dashboard.heroku.com/account and yourherokuappname from https://dashboard.heroku.com/apps

    Also, if you are using a Procfile to declare what commands are run by your application's dynos on the Heroku platform, there is NO need for a worker line (worker: bundle exec rake jobs:work) in Procfile -- that would only be need if you were not using workless.