Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

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've been using Monit to monitor my Thin server and everything was working until I upgraded my Rails version from 2.3.4 to 2.3.14. Now when I try and start Thin using monit it gives me an unfound gem error:

Missing the Rails 2.3.14 gem. Please `gem install -v=2.3.14 rails`

I thought this may be a GEM PATH issue and also tried setting the GEM_HOME and PATH variables in the start command:

check process thin3001
  with pidfile /home/blahblah/apps/Vocab/shared/pids/
  start program = "/usr/bin/env PATH=/usr/lib/ruby/gems/1.8/gems GEM_HOME=/usr/lib/ruby/gems/1.8/gems /usr/bin/ruby /usr/bin/thin -C /etc/thin/vocab.yml start -o 3001"
  stop program = "/usr/bin/ruby /usr/bin/thin -C /etc/thin/vocab.yml stop -o 3001"
  if totalmem > 150.0 MB for 5 cycles then restart
group thin

It's strange because if I run the start command in the console it works fine, it's only within monit that I get the missing Gems error.

share|improve this question
Which rack version are you running gem list rack? – quanta Sep 1 '12 at 6:29
rack (1.1.3, 1.0.0) – TenJack Sep 4 '12 at 19:15
up vote 1 down vote accepted

Ok, came across something about monit not loading the console environment and I guess it was not loading the correct Ruby path or something. Anyways, got it to work with the following:

start program = "/bin/su - user -c '/usr/bin/thin -C /etc/thin/vocab.yml start -o 3000'"

The "/bin/su - user -c" loads the shell environment of user (you need to replace this with your username).

share|improve this answer

I suspect that the latest rack doesn't work with the current version of thin. Uninstall rack 1.1.3 to see if your problem go away:

gem uninstall rack -v=1.1.3
share|improve this answer
Ok, thanks. Thing is, thin starts fine when I run it in the console. Also, I get this warning when I go to uninstall, "actionpack-2.3.14 depends on [rack (~> 1.1.0)]." – TenJack Sep 8 '12 at 22:58

Your Answer


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

Not the answer you're looking for? Browse other questions tagged or ask your own question.