Skip to content

Instantly share code, notes, and snippets.

@darkamenosa
Created August 13, 2024 04:23
Show Gist options
  • Save darkamenosa/4124ba6847ab5f0b39cf6fe65c3146b2 to your computer and use it in GitHub Desktop.
Save darkamenosa/4124ba6847ab5f0b39cf6fe65c3146b2 to your computer and use it in GitHub Desktop.
Rails Redis Sidekiq note - To avoid conflict sidekiq with multiple rails app in same development machine
  1. Create a redis.cnf file with different port, it looks like this:
port 6380
daemonize no
appendonly no
save "" 
  1. Adjust file Procfile.dev

Add this line redis: redis-server config/redis.conf

The content of the Procfile.dev should be something like this

web: bin/rails server 
css: bin/rails tailwindcss:watch
redis: redis-server config/redis.conf
worker: bundle exec sidekiq

Another the code the web: bin/rails server should be on the top of the file, if not, it can cause some wierd prolem with start up port

  1. Adjust config/cable.yml a little bit
development:
  adapter: redis
  url: <%= ENV.fetch("REDIS_URL") { "redis://localhost:6379/1" } %>
  1. Then run export REDIS_URL=6380
  2. Run the app again
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment