Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Paperclip can't find imagemagick

Okay, I have imagemagick installed on my local machine via homebrew, and Gemfile.lock shows paperclip locked at version paperclip (3.0.4).

Per the setup instructions, I set the following command in development.rb

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

Which lines up with what the terminal says

$ which identify
  # => /usr/local/bin/identify

However, when I try to upload an image, the following error spits out on my form

/var/folders/dm/lnshrsls2zz6l4r_tkbk7j2w0000gn/T/avatar20120522-44111-gfis2q.jpg is not recognized by the 'identify' command.

Which every SO question I can find on the matter suggests the problem is Paperclip can't find identify in it's command path.

I used the Paperclip generator to add the avatar to my database, and my model has:

has_attached_file :avatar, :styles => { :medium => "300x300>", :thumb => "100x100>" }

Furthermore, if I load up rails c and look at Paperclip.options, I can see the command path has been properly set in the hash.

Not quite sure what to do at this point. Any help would be appreciated.

like image 736
DVG Avatar asked May 22 '12 20:05

DVG


1 Answers

I'm glad that running the command got you started on the right path.

The problem was that your ImageMagick was compiled for the wrong architecture:

dyld: Library not loaded: /usr/local/lib/libtiff.3.dylib Referenced from: /usr/local/bin/identify Reason: image not found Trace/BPT trap

Uninstalling imagemagick, updating homebrew and reinstalling it was the right thing to do.

like image 73
Ivan Avatar answered Sep 21 '22 12:09

Ivan