当我尝试在本地机器上使用Paperclip在Ruby on Rails中上传照片时,它运行良好。
当我尝试在带有 Apache 和Phusion Passenger的 Linux( CentOS 5.2)服务器上使用 Paperclip 在 Ruby on Rails 中上传照片时,我得到:
2 errors prohibited this user from being saved
There were problems with the following fields:
- Avatar /tmp/stream20091026-21120-1qdbnul-0 is not recognized by the 'identify' command.
- Avatar /tmp/stream20091026-21120-1qdbnul-0 is not recognized by the 'identify' command.
我尝试添加:
Paperclip.options[:command_path] = "/usr/local/bin"
到 production.rb 但它没有任何区别。
在日志文件中,我收到以下错误:
参数:{"commit"=>"Upload", "action"=>"update", "_method"=>"put", "authenticity_token"=>"419410afc22737cd2f6b6096a95327db76a48ba9", "controller"=>"users", "user "=>{"avatar"=>#}} [回形针] 保存附件。[回形针] 处理时收到错误:
“识别”命令无法识别 /tmp/stream20091026-20752-1g568yk-0。