Search code examples
rubyruby-on-rails-3.1background-processsidekiq

Starting Sidekiq with rails server in development environment


I am using Sidekiq for some of my background processes.

Currently what I do is:

start bundle exec rails s on one terminal and then start bundle exec sidekiq on a different terminal so that the sidekiq starts itself and look for jobs to process.

What I want is:

As soon as i start bundle exec rails s it should also start the sidekiq bundle exec sidekiq. How can i integrate it in just Development environment ??


Solution

  • For apps like yours which require a number of services to be running consider using foreman and a Procfile to define those processes. Then you can use foreman start to run all of them in a single terminal.