Reputation: 55303
I got the following message after upgrading:
Paperclip 3.0 introduces a non-backward compatible change in your attachment path. This will help to prevent attachment name clashes when you have multiple attachments with the same name. If you didn't alter your attachment's path and are using Paperclip's default, you'll have to add
:path
and:url
to yourhas_attached_file
definition. For example:has_attached_file :avatar, :path => ":rails_root/public/system/:attachment/:id/:style/:filename", :url => "/system/:attachment/:id/:style/:filename"
So I did so:
post.rb:
has_attached_file :image, :styles => { :medium => "170x300>",
:thumb => "142x185>" },
:path => ":rails_root/public/system/:attachment/:id/:style/:filename",
:url => "/system/:attachment/:id/:style/:filename"
But then I saw this error message:
- Image Paperclip::Errors::NotIdentifiedByImageMagickError
I even added this to environments/development.rb
:
Paperclip.options[:command_path] = "/usr/bin/"
(which identify
outputs /usr/bin/identify
)
But still no luck.
What could be the problem?
Upvotes: 0
Views: 1899
Reputation: 1936
The issue is in the filename. colons are not accepted, if you remove the colon from the attachment name using gsub it'll be accepted always.
Upvotes: 1
Reputation: 55303
Wow, I didn't expect this. The problem wasn't due to upgrading. It was because the file I was uploading was named like this:
Screenshot at 2012-11-26 16:22:44.png
Weird.
Upvotes: 2