$120 tested Claude codes · real before/after data · Full tier $15 one-timebuy --sheet=15 →
$Free 40-page Claude guide — setup, 120 prompt codes, MCP servers, AI agents. download --free →
clskills.sh — terminal v2.4 — 2,347 skills indexed● online
[CL]Skills_
Ruby on RailsintermediateNew

Rails Sidekiq

Share

Set up background jobs with Sidekiq

Works with OpenClaude

You are a Rails developer. The user wants to set up and configure Sidekiq for background job processing in a Rails application.

What to check first

  • Run bundle list | grep sidekiq to verify Sidekiq gem is installed
  • Check config/sidekiq.yml exists or needs to be created
  • Verify Redis is running: redis-cli ping should return PONG

Steps

  1. Add gem 'sidekiq' to your Gemfile and run bundle install
  2. Create config/sidekiq.yml with concurrency and queue settings
  3. Create a job class in app/jobs/ using rails generate job JobName
  4. Define the perform method in your job class with actual work logic
  5. Enqueue the job using JobName.perform_later(args) or JobName.set(wait: time).perform_later(args)
  6. Configure config/initializers/sidekiq.rb to set Redis connection and middleware
  7. Start Sidekiq with bundle exec sidekiq -c 5 -v (runs 5 concurrent workers)
  8. Monitor jobs using Sidekiq Web UI at /sidekiq after mounting in routes

Code

# Gemfile
gem 'sidekiq', '~> 7.0'
gem 'sidekiq-cron', '~> 1.8' # for scheduled jobs

# config/sidekiq.yml
---
:concurrency: 5
:timeout: 25
:verbose: false
:queues:
  - [critical, 3]
  - [default, 2]
  - [low, 1]

# config/initializers/sidekiq.rb
Sidekiq.configure_server do |config|
  config.redis = { url: ENV.fetch('REDIS_URL', 'redis://localhost:6379/1') }
  config.server_middleware do |chain|
    chain.add SidekiqMiddleware
  end
end

Sidekiq.configure_client do |config|
  config.redis = { url: ENV.fetch('REDIS_URL', 'redis://localhost:6379/1') }
end

# app/jobs/send_email_job.rb
class SendEmailJob
  include Sidekiq::Job
  sidekiq_options retry: 5, dead: true
  sidekiq_retry_in { |count| count * 60 + rand(30) }
  sidekiq_options queue: 'critical'

  def perform(user_id, email_type)
    user = User.find(user_id)
    MailerService.send_email(user, email_type)
  end
end

# Usage in controller or model
class PostsController < ApplicationController
  def create
    @post = Post.create(post_params)
    SendEmailJob.perform_later(@post.user_

Note: this example was truncated in the source. See the GitHub repo for the latest full version.

Common Pitfalls

  • Treating this skill as a one-shot solution — most workflows need iteration and verification
  • Skipping the verification steps — you don't know it worked until you measure
  • Applying this skill without understanding the underlying problem — read the related docs first

When NOT to Use This Skill

  • When a simpler manual approach would take less than 10 minutes
  • On critical production systems without testing in staging first
  • When you don't have permission or authorization to make these changes

How to Verify It Worked

  • Run the verification steps documented above
  • Compare the output against your expected baseline
  • Check logs for any warnings or errors — silent failures are the worst kind

Production Considerations

  • Test in staging before deploying to production
  • Have a rollback plan — every change should be reversible
  • Monitor the affected systems for at least 24 hours after the change

Quick Info

Difficultyintermediate
Version1.0.0
AuthorClaude Skills Hub
railssidekiqbackground-jobs

Install command:

curl -o ~/.claude/skills/rails-sidekiq.md https://clskills.in/skills/rails/rails-sidekiq.md

Related Ruby on Rails Skills

Other Claude Code skills in the same category — free to download.

Want a Ruby on Rails skill personalized to YOUR project?

This is a generic skill that works for everyone. Our AI can generate one tailored to your exact tech stack, naming conventions, folder structure, and coding patterns — with 3x more detail.