views:

296

answers:

4

I am getting the following error when uploading an image on the admin panel of spree (RoR e-commerce platform):

Paperclip::NotIdentifiedByImageMagickError in Admin/imagesController#create

/tmp/stream.4724.0 is not recognized by the 'identify' command.

Any ideas? Thanks.

A: 

I'm not saying this is the solution but it wouldn't hurt to check your file permissions. Can the user running imagemagick access files in /tmp/ ?

semanticart
+1  A: 

It sounds like the wrong identify command (which is part of ImageMagick) is being called (or, perhaps, it isn't installed at all). Can you confirm the path to this command on your server using:

which identify

Once you've determined where this command is installed (e.g. /usr/local/bin) then you can tell Paperclip about it by adding the following to your environment.rb (or production.rb etc) file:

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

(this is for Paperclip 2.2 and above. If you're using an earlier version you should use :image_magick_path not :command_path)

Olly
+1  A: 

I solved this problem by $ sudo apt-get install imagemagick

kgthegreat
A: 

+1 for olly's answer

satish