Are your lshttpd running as "nobody"? please check with "ps -ef | grep lshttpd".
Try command
sudo -u nobody /usr/local/bin/ruby -v
see if it works. If you got permission problem, you need to check the permission of directories along the path.
Is there any symbolic link along the path?
You can...