36

I've had ImageMagick, RMagick, & PaperClip working properly with everything setup including the config Paperclip.options[:command_path] in production.rb file.

All of a sudden I've started getting the following error:

Could Not Run The `Identify` Command. Please Install ImageMagick.

I've tried everything. I've reinstalled ImageMagick, etc. but no avail.

Any help would be greatly appreciated.

Jacob
  • 6,317
  • 10
  • 40
  • 58
  • I'm getting the same error too, were you able to resolve it? – Swamy g Apr 09 '12 at 18:02
  • 1
    If you use [brew](http://brew.sh/), you can easily install imagemagick by running `brew update`,`brew install imagemagick `. – Allen Apr 08 '15 at 05:45

9 Answers9

40

From a terminal, run the following command:

sudo apt-get install imagemagick
wchargin
  • 15,589
  • 12
  • 71
  • 110
danielgatis
  • 737
  • 7
  • 19
  • 5
    The OP stated he already reinstalled ImageMagick, further there is no way of knowing he is on a Debian based operation system. – Jan Sep 11 '12 at 21:11
22

You need to change the files production.rb and development.rb which are in:

config/environments:

# Paperclip config:
Paperclip.options[:image_magick_path] = "/opt/ImageMagick/bin"
Paperclip.options[:command_path] = "/opt/ImageMagick/bin"

Just add those two lines just before the last line and restart the server.

In MacOSX system, if you are using another location, just put the right PATH there.

Cris R
  • 1,339
  • 15
  • 27
19

For Mac users: just run the command brew install imagemagick.

Benjamin W.
  • 46,058
  • 19
  • 106
  • 116
BilalReffas
  • 8,132
  • 4
  • 50
  • 71
14

You can type

which convert and which identify

to check whether imagemagick is installed properly.

In my case, which convert returns /usr/local/bin/convert but identify not found.

I used brew install imagemagick before, so I run it again and return imagemagick already installed, it's just not linked.

Finally got the point, brew link imagemagick(or brew link --overwrite imagemagick)

Don't forget to add the Paperclip.options[:command_path] = "/usr/local/bin/" to your config/environment.rb file.

whyisyoung
  • 316
  • 5
  • 16
11

I had a same issue. This is what worked for me. From terminal, first:

sudo apt-get update

Then:

sudo apt-get install imagemagick
Nemus
  • 3,879
  • 12
  • 38
  • 57
6

I had this issue, when I had started rails server from my rubymine ide. It seems it does not load your .zshrc (in my case, could also be valid for .bashrc). So some environment variables that make imagemagick work with dvm were not set. For example:

export PATH=$HOME/local/imagemagick/bin:$PATH
export LD_LIBRARY_PATH=$HOME/local/imagemagick/lib:$LD_LIBRARY_PATH

Once I restarted from my terminal, the error was gone.

Jan
  • 6,532
  • 9
  • 37
  • 48
2

I had the same problem. It was caused by https://github.com/thoughtbot/paperclip/issues/1709

balexand
  • 9,549
  • 7
  • 41
  • 36
  • Thanks a ton for linking to this issue, I was running into this too. For Googlers' sake: in my case ImageMagick was installed and Paperclip integrated with it properly on a small scale, but when running jobs in a multi-threaded environment like Sidekiq, after a few hundred jobs suddenly Paperclip would "forget" where to find ImageMagick, and all jobs after that would fail. This was fixed in version 4.2.1 so upgrading should resolve it. – Topher Hunt May 29 '15 at 21:27
2

This is how I solved this issue:

sudo apt install imagemagick
freshmurry
  • 35
  • 5
1

For Cent OS users:

 sudo  yum install ImageMagick ImageMagick-devel

will do the job

vidur punj
  • 5,019
  • 4
  • 46
  • 65