Is your monit running the version of ruby you think it is? Ours wasn’t. If you check the monit docs for “Environment”, monit hoses whatever paths you have set up for root, and even ignores paths specified in /etc/environment . That means if you start a script with a shebang line like

#!/usr/bin/env ruby

It will only use the short path specified by monit to figure out where ruby is. Not the paths you have carefully set up globally and for specific accounts on your machine. If you use something like Ruby Enterprise Edition or RVM, you could easily be running the outdated system install of Ruby, which could be missing critical functionality for your scripts. Even solutions like this may not help. We ended up having to specify fully-qualified path names in the shebang lines for a few scripts to ensure they were using the correct version of ruby.

Just something to watch out for.