I get an error when trying to save png in a model with paperclip application.
My User Model:
class User < ActieRecord::Base attr_accessible :icon has_attached_file :icon, :url => "/system/users/icon/:hash.:extension", :hash_secret => "superSecretHashSecret", :styles => { :medium => "300x300>", :thumb => "100x100>" } end
Icon installation example:
u = User.last u.icon = open(Rails.root + "spec/fixtures/files/example.png") u.save
Example model error:
:icon => ["/var/folders/43/810gn/T/example20121104-36855-1v7t136.png is not recognized by the 'identify' command."]
There are several people who have sent similar questions to this, especially this one , but none of these solutions work for me.
My command_path parameter is set correctly:
O:~ $ which identify /usr/local/bin/identify
In development.rb
Paperclip.options[:command_path] = "/usr/local/bin/"
This can still be a problem. When I try to use `authentication directly, I get the following error:
O:~ $ identify workspace/app/spec/fixtures/files/example.png dyld: Library not loaded: /usr/lib/libltdl.7.dylib Referenced from: /usr/local/bin/identify Reason: image not found Trace/BPT trap: 5
Any suggestions on what's going on here?
I tried reinstalling ImageMagick
brew unlink imagemagick brew install imagemagick
Others recommended adding Rmagick . This is definitely not a prerequisite for using Paperclip, and it also did not help.
Another solution that has been proposed is to remove the :style property. However, this is not a solution. I need to do image processing.
I have a Paperclip working on another model in my project that processes documents that are not images / do not do any processing. Therefore, I know that this is probably related to this.
Any other suggestions to solve this?