install_sidekiq
🛠️ Install and Configure Sidekiq
Sidekiq is a popular background job processor that integrates seamlessly with Rails. Add the gem and configure Rails to use Sidekiq as the Active Job adapter so all your jobs run through it.
# Gemfile
gem 'sidekiq'
# then install
bundle install
In config/application.rb
or in your specific environment config (config/environments/development.rb
):
# config/application.rb
module YourApp
class Application < Rails::Application
# Use Sidekiq for background jobs
config.active_job.queue_adapter = :sidekiq
end
end
Make sure to start a Redis server and then launch Sidekiq with:
bundle exec sidekiq