Friday, July 8, 2011

Webistrano sh: ruby: command not found

I was attempting to push a deployment and got nothing more than a spinning wheel. I checked the production.log for webistrano  and found that I was getting an error.


sh: ruby: command not found

It took me a little digging, but I did find the fix as well as an explanation.


The cause:
Since Apache is not started from the shell, it does not load the environmental variables.
The fix:
Add the following to your apache global config to have apache load them at start.

# Load environmental variables:
SetEnv PATH /usr/bin:/usr/local/bin:/bin
SetEnv LD_LIBRARY_PATH /opt/whatever/lib

Credit goes to: http://blog.phusion.nl/2008/12/16/passing-environment-variables-to-ruby-from-phusion-passenger/

No comments:

Post a Comment