Search code examples
ruby-on-railsherokusidekiq

Rails: Starting Sidekiq on Heroku


I'm having a problem getting Sidekiq up and running on my Heroku deployed Rails app. I have my app working fine in development (and on Heroku without Sidekiq).

I created a Procfile with:

worker: bundle exec sidekiq

If I run heroku ps, the only process I see is web.1.

Should I see one for Sidekiq?

I do get an error:

Redis::CannotConnectError (Error connecting to Redis on localhost:6379) in my Heroku logs.

UPDATE: Found I probably needed heroku addons:add redistogo. Still not working. I feel I'm missing some basic configuration.

Is there something I need to do to get Redis up and running for my Heroku app?

I've been using Redis/Sidekiq for about a day, so this is new to me.

Thanks!

Greg


Solution

  • No you do not need any config with Heroku for Sidekiq, just add the RedisToGo plugin and you're on. Do not forget to attribute at least 1 worker to your app in your Heroku config.

    Here is my default Procfile:

    web: bundle exec thin start -p $PORT
    worker: bundle exec sidekiq -c 5 -v