{"id":14955364,"url":"https://github.com/don-phdev/rails-sidekiq","last_synced_at":"2026-02-16T04:36:22.001Z","repository":{"id":37486265,"uuid":"501680257","full_name":"Don-PhDev/rails-sidekiq","owner":"Don-PhDev","description":"Tutorial on how to start a Rails 7 app with Sidekiq","archived":false,"fork":false,"pushed_at":"2022-07-04T06:35:52.000Z","size":56,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-07T09:42:57.658Z","etag":null,"topics":["foreman","procfile","rails7","ruby-on-rails","sidekiq","tutorial"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Don-PhDev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-06-09T14:11:24.000Z","updated_at":"2024-10-10T15:38:38.000Z","dependencies_parsed_at":"2022-09-15T04:41:43.340Z","dependency_job_id":null,"html_url":"https://github.com/Don-PhDev/rails-sidekiq","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Don-PhDev/rails-sidekiq","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Don-PhDev%2Frails-sidekiq","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Don-PhDev%2Frails-sidekiq/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Don-PhDev%2Frails-sidekiq/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Don-PhDev%2Frails-sidekiq/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Don-PhDev","download_url":"https://codeload.github.com/Don-PhDev/rails-sidekiq/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Don-PhDev%2Frails-sidekiq/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278302558,"owners_count":25964520,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-04T02:00:05.491Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["foreman","procfile","rails7","ruby-on-rails","sidekiq","tutorial"],"created_at":"2024-09-24T13:11:02.929Z","updated_at":"2025-10-04T10:48:35.060Z","avatar_url":"https://github.com/Don-PhDev.png","language":"Ruby","readme":"# Rails 7 with Sidekiq\n\nSidekiq allows Rails to launch any task in the background.\nLet's see how, from zero to production.\n\n## Prerequisites\n\n#### Here are the tools we will use in this tutorial :\n\n* Ruby version\n\n```bash\n  ruby -v\n  ruby 3.1.1p18 // at least version 3\n```\n* npm version\n\n```bash\n  npm -v\n  8.12.1 // at least version 7.1\n```\n\n* Yarn version\n\n```bash\n  yarn -v\n  1.22.15 // at least 1.22.10\n```\n\n* PostgreSQL version\n\n```bash\n  psql --version\n  psql (PostgreSQL) 14.2\n```\n\n* Redis\n\n  Run to determine if redis is running\n\n```bash\n  redis-cli ping\n```\n\n* Foreman\n\n```bash\n  foreman -v\n  0.87.2\n```\n\n## Create a new Rails 7 app\n\n```bash\n  mkdir sidekiqrails \u0026\u0026 cd sidekiqrails  \n  echo \"source 'https://rubygems.org'\" \u003e Gemfile  \n  echo \"gem 'rails', '7.0.1'\" \u003e\u003e Gemfile  \n  bundle install  \n  bundle exec rails new . --force -d=postgresql --minimal\n```\n\n* Create a default controller\n```bash\n  echo \"class WelcomeController \u003c ApplicationController\" \u003e app/controllers/welcome_controller.rb\n  echo \"end\" \u003e\u003e app/controllers/welcome_controller.rb\n```\n\n* Create a default route\n```bash\n  echo \"Rails.application.routes.draw do\" \u003e config/routes.rb\n  echo '  get \"welcome/index\"' \u003e\u003e config/routes.rb\n  echo '  root to: \"welcome#index\"' \u003e\u003e config/routes.rb\n  echo 'end' \u003e\u003e config/routes.rb\n```\n\n* Create a default view\n```bash\n  mkdir app/views/welcome\n  echo '\u003ch1\u003eThis is h1 title\u003c/h1\u003e' \u003e app/views/welcome/index.html.erb\n```\n\n* Create database and schema.rb\n```bash\n  bin/rails db:create\n  bin/rails db:migrate\n```\n\n#### Then open application.rb and uncomment line 6 as follow :\n* Inside config/application.rb\n```bash\n  require_relative \"boot\"\n\n  require \"rails\"\n  # Pick the frameworks you want:\n  require \"active_model/railtie\"\n  require \"active_job/railtie\" # \u003c== Uncomment\n  # ... everything else remains the same\n```\n\n#### Then create the parent Class of all jobs :\n* Create a jobs directory inside app\n```bash\n  mkdir app/jobs \u0026\u0026 cd app/jobs\n```\n\n* Create a application_job.rb file, then paste this code\n```bash\n  # inside app/jobs/application_job.rb\n  class ApplicationJob \u003c ActiveJob::Base\n  end\n```\n\n## Add redis and sidekiq gems to your Rails app\n* Open your Gemfile, and add at the very bottom\n```bash\n  gem \"redis\"\n  gem \"sidekiq\"\n```\n\n* Run in your terminal\n```bash\n  bundle install\n```\n\n* Then add the following line inside config/application.rb\n```bash\n  # ...\n  class Application \u003c Rails::Application\n    config.active_job.queue_adapter = :sidekiq\n  # ...\n```\n\n## Create an example job\n* Create a new file under app/jobs/example_job.rb\n```bash\nclass ExampleJob \u003c ApplicationJob\n  queue_as :default\n\n  def perform(*args)\n    # Simulates a long, time-consuming task\n    sleep 5\n    # Will display current time, milliseconds included\n    p \"hello from ExampleJob #{Time.now().strftime('%F - %H:%M:%S.%L')}\"\n  end\n\nend\n```\n\n## License \u0026 Copyright\n© 2022 Don Forrest Usbal (Don-PhDev)\n\nLicensed under the [MIT License](LICENSE)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdon-phdev%2Frails-sidekiq","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdon-phdev%2Frails-sidekiq","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdon-phdev%2Frails-sidekiq/lists"}