How to get Sidekiq to work on Heroku?

This is my first attempt to get Redis to work on Heroku.

I added one working dyno (only today, so I haven’t paid yet), added the RedisToGo Nano add-on, checked the background jobs on my local machine and clicked the application on the hero.

heroku ps 

gives

 === web: `bundle exec rails server -p $PORT` web.1: up 2013/03/03 18:26:09 (~ 37m ago) === worker: `bundle exec rake jobs:work` worker.1: crashed 2013/03/03 19:02:15 (~ 1m ago) 

Sidekiq's web interface says that one job is in the queue, but zero was processed or failed.

I guess my working dyno crashed.

Are there any errors that I don’t know?

(for example, I need to run some command to start listening to background jobs, etc.)

heroku logs --tail does not show any errors, so I don’t understand why my working dynamite.

+7
source share
2 answers

I did some research and fixed it as follows:

In the root directory of the application, I created a file called "Procfile" with this content:

 web: bundle exec rails server -p $PORT worker: bundle exec sidekiq -c 5 -v 

Got this idea from here .

After that, it worked fine.

+14
source

Also make sure you install REDIS_PROVIDER:

 heroku config:set REDIS_PROVIDER=REDISTOGO_URL 

The Sidekiq GitHub page also has instructions. Click here

0
source

All Articles