3

I have application using Rails 4 and Ruby 2. I started to use mongoid-paperclip and it is working fine.

I installed ImageMagick-6.8.6-8. I added Paperclip.options[:command_path] = "/usr/local/bin/" in development.rb. And I have mongoid-paperclip rmagick (~> 2.13.2) cocaine (0.5.1)

When I added "has_mongoid_attached_file :avatar, :styles => { :small => "160x160!" }" I started to get this error: Paperclip::Errors::NotIdentifiedByImageMagickError: Paperclip::Errors::NotIdentifiedByImageMagickError

Any help please I spent hours and hours without any luck.

amm
  • 293
  • 1
  • 2
  • 13

4 Answers4

2

NOTE: This solution is for OS-X machines and imagemagick installed via "brew"

Some of my students (I teach Rails at a dev bootcamp) had the exact same problem on their Mac OS-X machines. And, the following solution fixed them all.

The Cause

The cause of the problem is that jmagemagick is compiled using a wrong GCC compiler in your box. Although it probably has compiled into an executable (binary), however, when it runs, it fails due to linking errors (it's trying to dynamically load some dependencies, ie, libraries).

The Solution

You need to reinstall imagemagick using a correct GCC. If you have a Mac, please, follow the instructions below:

  1. Open XCode program (if you don't have it, install it)
  2. Go to Preference and open "Download" tab
  3. Download "Command line tool"
  4. After download is complete, open a terminal
  5. Run "brew reinstall imagemagick"

That should do it!

Yosep Kim
  • 2,931
  • 22
  • 23
  • I believe this should be accepted as the correct answer, especially if the original user was previously using an older version of OSX, as I was. – David Rhoden Jan 05 '14 at 14:40
0

When using brew install imagemagick, it seems to install a precompiled binary that lacks TIFF support. Use this to install ImageMagick with proper TIFF support:

brew install libtiff
brew reinstall imagemagick --with-libtiff

(Credits to Groveriffic: https://stackoverflow.com/a/13150641/235297)

Community
  • 1
  • 1
Ortwin Gentz
  • 52,648
  • 24
  • 135
  • 213
0

1- I have the same issue, and I solved it, when i configure the dynamic linker run-time bindings to create the necessary links and cache to the most recent shared libraries using the ldconfig command.

So you need to use the following command:

sudo ldconfig /usr/local/lib

Actually, I advice to re-install imagemagick using steps at how-to-install-image-magick-and-setup-paperclip.

2- You need to add the following code in development.rb file:

Paperclip.options[:command_path] = "/usr/local/bin/"
Mohamed Yakout
  • 2,868
  • 1
  • 25
  • 45
0

Running these two commands did the trick for me. Remember to use the --force since libtool is keg-only

brew install libtool --universal
brew link libtool --force
Kathan
  • 1,428
  • 2
  • 15
  • 31