Rails: Starting Sidekiq on Heroku

后端 未结 7 1428
心在旅途
心在旅途 2020-12-12 19:00

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 cr

7条回答
  •  暖寄归人
    2020-12-12 19:52

    Starting with sidekiq version 3.0 there is an additional step, run heroku config:set REDIS_PROVIDER=REDISTOGO_URL in the console.

    Here is the process I used for Rails 4:

    In the console:

    heroku addons:create redistogo
    heroku config:set REDIS_PROVIDER=REDISTOGO_URL
    

    In my Procfile I added:

    worker: bundle exec sidekiq
    

    In my gemfile.rb I added:

    gem 'redis'
    

    I added the following file, config/initializers/redis.rb:

    uri = ENV["REDISTOGO_URL"] || "redis://localhost:6379/"
    REDIS = Redis.new(:url => uri)
    

    Here is the link to the sidekiq docs.

提交回复
热议问题