V
V
vladimir_e2012-11-14 12:06:59
Ruby on Rails
vladimir_e, 2012-11-14 12:06:59

Why doesn't paperclip see ImageMagick?

Good afternoon colleagues!
Faced such a problem. Paperclip returns an error:

some.jpg is not recognized by the 'identify' command.

I'm running OS X Mountain Lion and first installed imageMagick using "ImageMagick installer for Mac OS X", it installed in /opt/ImageMagick/bin
I created an initializer with the following line:
Paperclip.options[:command_path] = "/opt/ImageMagick/bin"

The error remains. Then I installed ImageMagick using macports
sudo port install ImageMagick
, everything was installed, commands were added to PATH, I changed the path in the initializer to "/opt/local/bin", but paperclip keeps pretending that it can't find identify.
Tried to add the "rmagick" gem, the problem persists.
Any ideas what else to try? I will be very grateful.
UPD:
I tried in the terminal:
$> identify ~/Pictures/nature/007.jpg 
 /Users/vlad/Pictures/nature/007.jpg JPEG 800x600 800x600+0+0 8-bit sRGB 69.3KB 0.000u 0:00.000

Uploading via paperclip in my rails app, getting the same error.
UPD2:
I tried it in the rails console:
1.9.3p194 :001 > Magick::ImageList.new("/Users/Vlad/Pictures/nature/007.JPG")
# => [/Users/Vlad/Pictures/nature/007.JPG JPEG 800x600 800x600+0+0 DirectClass 8-bit 67kb] scene=0

so rmagick is working.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
vladimir_e, 2012-11-14
@vladimir_e

As a result, I took paperclip from github and it worked. Turns out I had an older version.
Nevertheless, all my attempts, which are described in the question, may be useful to someone.
The solution
was:

gem "paperclip", "~> 3.1.4"

the error is that for some reason I used "~>" (restricts gem update above 3.1.X), instead of >= which would download the latest version.
did like this:
gem "paperclip", github: "thoughtbot/paperclip"

I
Ilya Lazarev, 2014-06-29
@CrusaderGo

And immediately get on the github?)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question