Question
Rails 4 PaperClip ImageMagick Content Type Error for Images
I’m using ImageMagick and Paperclip for uploading images to my Rails app. It is working on my development machine, a Mac, but not here. When Paperclip tries saving different sizes of the images, ImageMagick give the error
Paperclip::Errors::NotIdentifiedByImageMagickError
I’m using Paperclip 4.2.1. In my Rails model I have:
has_attached_file :photo_image, :styles => { :medium => "330x250#", :small => "150x120#", :thumb => "120x100#" },
:url => "/system/dadverts/:attachment/:id/:style/:filename",
:path => ":rails_root/public/system/dadverts/:attachment/:id/:style/:filename",
:default_url => "300250ad.png"
validates_attachment_content_type :photo_image, :content_type => /\Aimage/
In my production environment settings I have:
Paperclip.options[:command_path] = "/usr/local/bin/"
I’ve run sudo apt-get update a couple of times but this has not resolved the issue.
Any suggestions on what could be wrong would be appreciated.
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
×