我在我的Rails应用程序中使用PaperClip插件,如下所示:
has_attached_file :photo,:styles => {:small => '64X64>',:medium => '250X250>'},:url => "/assets/user_photos/:id/:style/:basename.:extension",:path => ":rails_root/public/assets/user_photos/:id/:style/:basename.:extension" # validates_attachment_presence :photo validates_attachment_content_type :photo,:content_type => ['image/jpeg','image/png','image/gif'] validates_attachment_size :photo,:less_than => 1.megabytes
它在开发上运行良好(Mac OSX Mongrel).但是当我把它投入生产时(Linux Debian Apache / Passenger)它只接受.gif并且我得到以下错误:.png和.jpg:
Photo /tmp/stream20091028-20066-1t1a0oz-0 is not recognized by the 'identify' command. Photo /tmp/stream20091028-20066-1t1a0oz-0 is not recognized by the 'identify' command.
我尝试添加以下行作为一些教程建议,但它没有帮助!
Paperclip.options[:command_path] = "/usr/local/bin"
解决方法
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。