I've got a custom Apache initializers to be able to have my Homebrew binaries accessible:
SetEnv PATH /usr/local/bin:/usr/local/sbin:$PATH
However, my Rails (3..4) programs cannot find any binaries unless of course full pathways receive. For instance:
begin `convert` raise Errno::ENOENT if $?.exitstatus == 127 rescue Errno::ENOENT logger.info "command 'convert' not found: ensure Image Magick is installed" end
Leads to the best being elevated every time (despite the fact that the convert binary is available under '/usr/local/bin/convert'). Any tips on how to fix this so my Rails programs know of the path? Thanks!
I am unsure basically did a method update or what went down exactly, however i had both Brew and Port set up on my small system. I'd two initializer files:
# ./other/port.conf SetEnv PATH /opt/local/bin:/opt/local/sbin:$PATH # ./other/brew.conf SetEnv PATH /usr/local/bin:/usr/local/sbin:$PATH
The soution ended up being to take away the unused
port.conf. Unsure why it was leading to issues in Apache (and that i appear to keep in mind it working previously). However, multiple calls to
SetEnv appear to overwrite eachother.
It isn't really your particular problem, but it is something to check on.
There is a regression in Apache that made
SetEnv not work with
PATH. It was fixed in revision 965679 (This summer, 2010). If you are utilizing an older installing of Apache, you might be striking this bug.
config/environments/production.rb, you are able to set atmosphere variables such as this:
ENV["PATH"] = "..."