I’m using paperclip to handle image uploads to rails. it worked fine on my dev OSX machine, but now on my web server I get this error:
[paperclip] /Users/marky/bin/identify '-format' '%wx%h' '/tmp/stream,16451,2.JPG[0]' 2>/dev/null
[paperclip] An error was received while processing: #<Paperclip::CommandNotFoundError: Paperclip::CommandNotFoundError>
[paperclip] /Users/marky/bin/identify '-format' '%wx%h' '/tmp/stream,16451,2.JPG[0]' 2>/dev/null
[paperclip] An error was received while processing: #<Paperclip::CommandNotFoundError: Paperclip::CommandNotFoundError>
Now it’s clear to me the reason; identify is actually in /usr/bin/ not /Users/marky/bin/ which is from my dev machine. I have:
Paperclip.options[:command_path] = "/usr/bin"
in my development.rb, but I’m still getting the error. I have no idea how to fix this, can anyone help?
If you are hosting your application with Passenger, keep in mind that Passenger does not have the same $PATH variable as your logged in user. A good way to check whether Passenger can see the ImageMagick commands is to add this to one of your erb templates:
and to compare the results with running the same commands in your terminal. Another possibility is ImageMagick can’t find the libs it needs. In this case, you may need to export another variable to let ImageMagick know where the libs are:
Hope that helps -jerry