Paper clip cannot find imagemagick

Well, I have imagemagick installed on my local machine via homebrew, and Gemfile.lock shows that the clip is locked in paperclip (3.0.4) .

In the installation instructions, I installed the following command in development.rb

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

What line indicates what the terminal says

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

However, when I try to upload an image, the following error appears in my form

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

That every SO question that I can find on this question suggests that the problem is that Paperclip cannot find an identification path in it.

I used a clip generator to add an avatar to my database, and my model:

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

Also, if I load rails c and look at Paperclip.options, I see that the command path was set correctly in the hash.

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

+8
ruby-on-rails homebrew imagemagick paperclip
source share
3 answers

I am glad that running the command launched you 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 

Removing imagemagick, updating homebrew and reinstalling it was correct.

+10
source share

Just in case, I did this with this trick:

 ln -s /usr/local/Cellar/libtiff/3.9.5/lib/libtiff.3.dylib /usr/local/lib/libtiff.3.dylib 

And it works like a charm :)

+4
source share

Not quite sure what the problem was, however I uninstalled Image Magick, updated Homebrew and reinstalled imagemagick, and now everything works.

0
source share

All Articles