Bash Command which Rails does Not Find

2019-08-04 11:51发布

Passenger says:

Ruby on Rails application could not be started
...
Command 'exiftool' not found (MiniExiftool::Error)

When I login with ssh and I type exiftool in any directory the command works properly.

I have the follwing line in both .bash_profile and .bashrc

export PATH=$PATH:$HOME/bin

Is it possible that Rails (MiniExiftool plugin) does not recognize that bash command? How can I fix this behaviour?

1条回答
beautiful°
2楼-- · 2019-08-04 12:28

The PATH for the user your server runs as does not include the directory that exiftool is in. You can either add it to that user's path, or you can refer to exiftool using its full path. I'd recommend this second approach for reasons of security. There are a number of attacks that involve putting trojan horses in a user's path ahead of the directories where the real binaries live.

查看更多
登录 后发表回答