【发布时间】:2012-10-06 18:19:32
【问题描述】:
我正在尝试让回形针 gem 将图像上传到我的生产服务器(ubuntu 12.0.4、apache2、phusion 乘客和 rvm),并且对于每个附件,我都会收到三个这样的验证错误:
图像之一 /tmp/villa-0520121006-4333-hdo9wv.jpeg 无法被“识别”命令识别。
ImageMagick 已正确安装,libmagickwand-dev 包、Rmagick 和回形针也是如此。 我已经将正确的 command_path 设置为 identify 和 convert 在我的 production.rb 配置文件中的位置。
如果有帮助,这是我的模型:
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
我真的对此一头雾水,任何帮助或建议将不胜感激 谢谢
【问题讨论】:
标签: ruby-on-rails-3 imagemagick paperclip