2009-10-26 15 views
5

Gdy próbuję wgrać zdjęcie w Ruby on Rails przy użyciu Paperclip na mojej lokalnej maszynie, działa idealnie.Spinacz do papieru/pasażera NotIdentifiedByImageMagickError:

Kiedy próbuję załadować zdjęcie w Ruby on Rails z wykorzystaniem spinacza na naszej Linux (CentOS 5.2) Serwer z Apache i Phusion Passenger, otrzymuję:

2 errors prohibited this user from being saved 
There were problems with the following fields: 
- Avatar /tmp/stream20091026-21120-1qdbnul-0 is not recognized by the 'identify' command. 
- Avatar /tmp/stream20091026-21120-1qdbnul-0 is not recognized by the 'identify' command. 

Próbowałem dodając:

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

do production.rb, ale to nie miało znaczenia.

w plikach dziennika uzyskać następujące błędy:

Parameters: {"commit"=>"Upload", "action"=>"update", "_method"=>"put", "authenticity_token"=>"419410afc22737cd2f6b6096a95327db76a48ba9", "controller"=>"users", "user"=>{"avatar"=>#}} [paperclip] Saving attachments. [paperclip] An error was received while processing:

/tmp/stream20091026-20752-1g568yk-0 is not recognized by the 'identify' command.

Odpowiedz

4

Określenie to narzędzie wiersza polecenia wewnątrz opakowania ImageMagick.

Od swojej stronie internetowej:

The identify program describes the format and characteristics of one or more image files. It also reports if an image is incomplete or corrupt. The information returned includes the image number, the file name, the width and height of the image, whether the image is colormapped or not, the number of colors in the image, the number of bytes in the image, the format of the image (JPEG, PNM, etc.), and finally the number of seconds it took to read and process the image. Many more attributes are available with the verbose option.

Najpierw skopiuj obraz na serwer i uruchomić polecenie zidentyfikować na nim. Powinieneś otrzymać coś takiego:

identify ~/capture.jpg 
capture.jpg JPEG 1216x244 1216x244+0+0 8-bit DirectClass 97.7kb 

Jeśli pojawi się błąd, spróbuj zaktualizować pakiet ImageMagick na swoim serwerze. Można znaleźć zaktualizowaną binarny uwalnianie tutaj: http://www.imagemagick.org/script/binary-releases.php

+0

Po wielu ingerować udało mi się wypracować że biblioteki dla .jpeg .png nie zostały zainstalowane na naszym serwerze produkcyjnym Linux, ale są zainstalowane na moim imacu. Musiałem więc pobrać te biblioteki i zainstalować je, a następnie ponownie zainstalować imagemagick (nie pomógł fakt, że imagemagick.org nie działa przez całe popołudnie :() – Chris

0

w moim przypadku z tego samego błędu, ponownie zainstalować ImageMagick pomógł (Ubuntu 12.10)

Powiązane problemy