开发者

rails 3 paperclip imagemagick problem

I have been trying to get paperclip working for a few days now with no luck! From what I am aware this error below is related to imagemagick. I have tried to uninstall and install imagemagick both with macports and manually. Also, have Paperclip.options[:command_path] = "/usr/local/bin" set. It's starting to drive me nuts!

Photo /var/folders/A7/A7X8PAnOFsCTHkFpeODoO++++TI/-Tmp-/stream,65411,0.jpeg is not recognized by the 'identify' command.

I'm running snow leopard.

This appears when I run the rails server.. "/Users/michaelorcutt/shudder/vendor/plugins/paperclip/lib/paperclip.rb:50: warning: already ini开发者_C百科tialized constant VERSION"


I've seen this problem when I was configuring ImageMagick for Rails 3 on OSX. After installing ImageMagick from mac ports and then the binary things still didn't work correctly. What finally did the trick ? finding the location of the identify binary.

which identify

put that path into your :

Paperclip.options[:command_path] =

And it should finally work.


Here is the list of things that needs to be checked for error "NotIdentifiedByImageMagickError":

  1. Ensure that Imagemagick is installed on your system and its in the ENV path try the command $ which identify Or $which convert. For Ubuntu its usally in /usr/local/bin or /usr/bin.
  2. Note the path of the above command and update the config/environments/development.rb (if you are working in dev mode) with the following line.
Paperclip.options[:command_path]= '/usr/bin'

Incase, if you are still facing the issue check the installation of ImageMagick. If you installed from the source, the may be try packaged installation ( sudo apt-get install imagemagick)

~arunky


I currently use Paperclip, ImageMagick from macports in my Snow Leopard and havent seen that issue, are you sure that file is jpg? Try renaming it to jpg (it would be stupid, but you have to rule out everything).

Try opening several of your JPG files in a text editor, and open that one and see if the first 4 characters match (or better yet do it in a binary editor). Maybe it is a file your operating system or other software recognizes as image, but is not an actual jpg and ImageMagick is confused.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜