0

I am having some trouble with paperclip.

It seems I cannot resize images when i upload them. If i do no resize it's fine. The error I get is this:

[paperclip] An error was received while processing: #<Paperclip::Errors::NotIdentifiedByImageMagickError: /var/folders/xd/6z05jyw16_vcvwxdr6qwtz2w0000gn/T/DS44526.jpg is not recognized by the 'identify' command.>

Now, I've tried setting stuff in the environment files but nothing works.

here's the thing: projects i find from the net work, like the one from thoughtbot(https://github.com/thoughtbot/paperclip_demo)

so i actually made a new project, and copied and pasted the code from the paperclip-demo and I STILL couldn't get it to work. same error.

So, what on earth could I be missing here??

So, one from thoughtbot: works. One I make using rails new: doesn't. one i copy/paste from thoughtbot: doesn't.

so.. what could possibly be different?

  • did you look at http://stackoverflow.com/questions/4981336/ruby-on-rails-paperclip-identify-command-working-in-cmd-but-not-in-app – apneadiving Oct 09 '12 at 07:12
  • have a look at http://stackoverflow.com/questions/1533351/paperclip-error – Prasad Surase Oct 09 '12 at 07:18
  • I have been googling and tinkering for a good while on this. I did try that extensivly. heres the thing: the one from thoughtbot has nothing like that. So i can't figure out whats different between that and something i make –  Oct 09 '12 at 07:21
  • try to run identify command from your terminal,if it runs then set that path in env file – Rubyman Oct 09 '12 at 07:58

3 Answers3

1

Figured it out. Answering my own question for the googling of others.

Clearing out gemfile.lock for the thoughtbot demo app was able to reproduce the problem.

so, in my project, i cleared out the gemfile.lock, set paperclip to 2.7, and it worked! upgrading to 3 also worked as well. So it seems 3, on a new install, had some errors for me.

0

Maybe there is something wrong with the JPG, for example it could be a PNG named as JPG, or it has a wrong compression format. Try to convert it to a different format, for instance to PNG, and upload it again.

0x4a6f4672
  • 27,297
  • 17
  • 103
  • 140
0

First: check if identify runs correctly: run it from the command line with your jpg as parameter. If it runs OK, you know it must be access to the identify command that is the culprit, either by providing the wrong path (see comments above, it took me some time too before it worked) or having no access to the path (does the webrick/thin run as another user?).

If it gives an error, probably your jpg is broken.

Hugo Logmans
  • 2,202
  • 1
  • 19
  • 14
  • yes, identify runs from command line. But not from the app. The demo app from thoughtbot has nothing in it's configs to specify the path to identify but it works just fine. yet I cannot replicate. –  Oct 09 '12 at 17:20