I don't know if my $summary solution is actually correct (or the best one) since I don't know anything about ruby, but fixed it for me I've CC'ed ruby team for their suggestion
require 'rubygems' rescue LoadError that would solve the problem if rubygems is not present. OTOH it would be nice if we made sure that Apache got the proper environment set (i.e. /etc/profile got sourced).