I’m migrating from Active Record to Mongoid, and this paperclip stuff used to work fine. I’m using Ubuntu 12.04.
I’ve got this code in my mongoid document:
has_mongoid_attached_file :photo,
:styles => {
:thumb => "60x60",
:small => "100x100",
:medium => "300x200",
:large => "600x400"
},
:storage => :s3,
:s3_credentials => "#{Rails.root}/config/s3.yml",
:path => "#{Rails.env}/merc:attachment/:id/:style.:extension",
:url => ":s3_alias_url",
:bucket => '%^&*&^'
I have the rmagick gem installed and the command_path pointing to where the various imagemagick commands are -> ‘/usr/bin’.
I’m using Unicorn as my webserver, and I have verified that identiy and convert are available by putting this in my view:
<%= `which convert` %>
<%= `echo $PATH` %>
But alas, when I try to upload the image I get :
Photo /tmp/qdoba20121005-27609-1m3kq9c.jpg is not recognized by the
'identify' command. Photo /tmp/qdoba20121005-27609-1m3kq9c.jpg is not
recognized by the 'identify' command. Photo
/tmp/qdoba20121005-27609-1m3kq9c.jpg is not recognized by the
'identify' command. Photo /tmp/qdoba20121005-27609-1m3kq9c.jpg is
not recognized by the 'identify' command.
Seemingly one for every one of the styles I have defined.
I’ve confirmed that the file exists, and I can run identify on the file from the commandline.
Any help will be appreciated. Thanks!
There is a recent update to the Cocaine gem that is breaking the imagemagick filenames for a lot of people – check it out because rolling back Cocaine to the previous version may help.
See here:
https://github.com/thoughtbot/paperclip/issues/1038