Setup Sidekiq in a Rails 8 app

Add the Sidekiq gem

gem 'sidekiq'

And remove (or comment out):

gem 'solid_queue'

Add this line to all configs

Add to development.rb, staging.rb, production.rb:

config.active_job.queue_adapter = :sidekiq

And comment out the other lines (which are in staging and production configs):

# config.active_job.queue_adapter = :solid_queue
# config.solid_queue.connects_to = { database: { writing: :queue } }

Add the Sidekiq web UI

Add this line to the very top of routes.rb (above the routes opening block)

require 'sidekiq/web'

Add this into the routes:


# Only mount Sidekiq Web UI if the user is authenticated as an admin
authenticate :user, lambda { |u| u.admin? } do
  mount Sidekiq::Web => '/admin/sidekiq'
end

Last updated