Bash Command which Rails does Not Find

社会主义新天地 提交于 2019-12-11 10:54:49

问题


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:


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.



来源:https://stackoverflow.com/questions/1240750/bash-command-which-rails-does-not-find

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!