rails回形针和乘客`'识别'命令无法识别` [英] rails paperclip and passenger `is not recognized by the 'identify' command`

查看:28
本文介绍了rails回形针和乘客`'识别'命令无法识别`的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

When I upload a photo, my model fails validation, err well even without any validations I'm returned this error:

/tmp/stream20100103-13830-ywmerx-0 is not recognized by the 'identify' command. and     
/tmp/stream20100103-13830-ywmerx-0 is not recognized by the 'identify' command.

I'm confident this is not related to ImageMagick because I've removed any image processing from the uploading, also I've tried uploading different mime types, like .txt files and the such.

Additionally, I found something that may work. A blog post claims that putting the following in my environment (in this case development.rb)

Paperclip.options[:command_path] = "/opt/local/bin"

解决方案

This is related to ImageMagick. The command_path option needs to point to the location where identify is installed. From the command line, you can determine this with which identify.

$ which identify
/some/path/to/identify

Afterwards, set command_path to that path (in config/environments/development.rb):

Paperclip.options[:command_path] = "/some/path/to"

这篇关于rails回形针和乘客`'识别'命令无法识别`的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆