Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have used AWS Opsworks to create some servers. I have Sidekiq running as part of my Rails application. When I deploy Sidekiq restarts nicely.

I am configuring Monit to watch the pid and start and stop Sidekiq if there are any issues. However when Monit trys to start Sidekiq I see that the wrong Ruby looks to be used.

Oct 17 13:52:43 daitengu sidekiq:  /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.3.4/lib/bundler/definition.rb:361:in `validate_ruby!': Your Ruby version is 1.8.7, but your Gemfile specified 1.9.3 (Bundler::RubyVersionMismatch)
Oct 17 13:52:43 daitengu sidekiq:   from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.3.4/lib/bundler.rb:116:in `setup'
Oct 17 13:52:43 daitengu sidekiq:   from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.3.4/lib/bundler/setup.rb:17

When I run the command from the cli Sidekiq launches correctly.

$> cd /srv/www/myapp/current && RAILS_ENV=production nohup /usr/local/bin/bundle exec sidekiq -C config/sidekiq.yml >> /srv/www/myapp/shared/log/sidekiq.log 2>&1 &
$> ps -aef |grep sidekiq
root      1236  1235  8 20:54 pts/0    00:00:50 sidekiq 2.11.0 myapp [0 of 25 busy]

My sidekiq.monitrc file

check process unicorn with pidfile /srv/www/myapp/shared/pids/
    start program = "/bin/bash -c 'cd /srv/www/myapp/current && /usr/local/bin/bundle exec unicorn_rails --env production --daemonize -c /srv/www/myapp/shared/config/unicorn.conf'"
    stop program = "/bin/bash -c 'kill -QUIT `cat /srv/www/myapp/shared/pids/`'"
share|improve this question
Your sidekiq.monitrc checks unicorn process? – MikDiet Mar 23 '14 at 8:02

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.