By RedMagnum30
I’m using ImageMagick and Paperclip for uploading images to my Rails app. It is working on my development machine, a Mac, but not here. When Paperclip tries saving different sizes of the images, ImageMagick give the error
Paperclip::Errors::NotIdentifiedByImageMagickError
I’m using Paperclip 4.2.1. In my Rails model I have:
has_attached_file :photo_image, :styles => { :medium => "330x250#", :small => "150x120#", :thumb => "120x100#" },
:url => "/system/dadverts/:attachment/:id/:style/:filename",
:path => ":rails_root/public/system/dadverts/:attachment/:id/:style/:filename",
:default_url => "300250ad.png"
validates_attachment_content_type :photo_image, :content_type => /\Aimage/
In my production environment settings I have:
Paperclip.options[:command_path] = "/usr/local/bin/"
I’ve run sudo apt-get update a couple of times but this has not resolved the issue.
Any suggestions on what could be wrong would be appreciated.
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
asb, I checked the list and found that JPEG and PNG were missing from the list. I’ll try your suggestion and let you know how it goes. Do you think I should delete the current installation and start over? If so, what recommendations would you have for making sure I get it all and not leave anything behind that would cause any conflicts?
Thanks.
The List.
asb,
I did install from source code, I found the instructions from somewhere but can’t find the URL. It does upload GIF files but nothing else.
“which convert?” shows “/usr/local/bin/convert”
Thanks
Judging from the paperclip documentation, Paperclip.options[:command_path] should be set to the path that the convert binary and other ImageMagick utilities are installed at. How did you install ImageMagick?
If you installed it using apt-get on Ubuntu it is likely in /usr/bin/ not /usr/local/bin/ What is the output of which convert ?
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.