paperclip gem验证错误 - 'identify'命令无法识别'filename' [英] paperclip gem validation error - 'filename' is not recognized by the 'identify' command

查看:153
本文介绍了paperclip gem验证错误 - 'identify'命令无法识别'filename'的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将paperclip gem上传到我的生产服务器上的图像(ubuntu 12.0.4,apache2,phusion passenger和rvm),对于每个附件,我得到了三个这样的验证错误:

I'm trying to get the paperclip gem to upload images on my production server (ubuntu 12.0.4, apache2, phusion passenger and rvm) and for each attachment I get three lots of this validation error:


识别命令无法识别/tmp/villa-0520121006-4333-hdo9wv.jpeg。

Img one /tmp/villa-0520121006-4333-hdo9wv.jpeg is not recognized by the 'identify' command.

正确安装ImageMagick,libmagickwand-dev软件包,Rmagick和paperclip也是如此。
我已经将正确的command_path设置到我的production.rb配置文件中识别和转换的位置。

ImageMagick is installed properly, as is the libmagickwand-dev package, Rmagick and paperclip. And I've set the correct command_path to where identify and convert are located in my production.rb config file.

如果有帮助,这是我的模型:

here is my model if it helps:

class Property < ActiveRecord::Base
    attr_accessible :img_one, :img_two, :img_three, :img_four, :img_five, :img_six, :price, :title, :description, :location, :beds, :property_type, :agreement_type, :featured  
    has_attached_file :img_one, :styles => { :medium => "420x280>", :mobile => "300x220", :thumb => "100x80>" }
    has_attached_file :img_two, :styles => { :medium => "420x280>", :mobile => "300x220", :thumb => "100x80>" }
    has_attached_file :img_three, :styles => { :medium => "420x280>", :mobile => "300x220", :thumb => "100x80>" }
    has_attached_file :img_four, :styles => { :medium => "420x280>", :mobile => "300x220", :thumb => "100x80>" }
    has_attached_file :img_five, :styles => { :medium => "420x280>", :mobile => "300x220", :thumb => "100x80>" }
    has_attached_file :img_six, :styles => { :medium => "420x280>", :mobile => "300x220", :thumb => "100x80>" }


    validates_presence_of :title, :description, :location, :beds, :property_type, :agreement_type, :price
    validates :price, :numericality => { :greater_than => 0 }
    validates :beds, :numericality => { :only_integer => true, :greater_than => 0 }
end

我真的对这个问题感到头疼,任何帮助或建议将非常感谢
谢谢

I'm really scratching my head with this one and any help or advice would be much appreciated thanks

推荐答案

这显然是由可卡因宝石0.4.0打破回形针造成的(我我正在使用paperclip 3.2.0)。为了解决这个问题,我通过以下方式恢复了该宝石的旧版本:

This was apparently caused by the cocaine gem 0.4.0 breaking paperclip (I'm using paperclip 3.2.0). To fix the issue I reverted back to an older version of that gem by doing:


gem uninstall cocaine

gem uninstall cocaine

将此添加到gemfile

adding this to gemfile


gem'cocaine','0.3.2 '

gem 'cocaine', '0.3.2'

然后捆绑安装


捆绑安装

bundle install

识别命令无法识别图像文件。 (heroku)
https://github.com/thoughtbot/paperclip / issues / 1038

这篇关于paperclip gem验证错误 - 'identify'命令无法识别'filename'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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