"identify"命令无法识别图像文件.(Heroku的)

Loï*_*ant 9 ruby-on-rails imagemagick heroku amazon-s3 paperclip

我正在努力让Paperclip与Heroku和Amazon S3合作.

在localhost(mac OS和Amazon)上一切正常,但是当我部署到heroku并尝试该功能时,我有这个错误:

2 errors prohibited this area from being saved:
Asset /tmp/paris20121005-2-2cwxgx.jpg is not recognized by the 'identify' command.
Asset /tmp/paris20121005-2-2cwxgx.jpg is not recognized by the 'identify' command.
Run Code Online (Sandbox Code Playgroud)

它在我的模型中删除:styles => {}选项时有效,但文件未处理(我需要不同的图像大小).

我的gemfile中也有rmagick gem.

这是我的gemfile(只有回形针部分):

gem "paperclip"
gem "rmagick", :require => 'RMagick'
gem 'aws-sdk', '~> 1.3.4'
Run Code Online (Sandbox Code Playgroud)

我没有在我的environment.rb或production.rb中设置Paperclip.options [:command_path]所以这方面没问题.

这是我的模型:

class Area < ActiveRecord::Base
  require 'RMagick'
  has_attached_file :asset, :styles => { :medium => "300x300>", :thumb => "180x190>" },
       :storage => :s3,
       :s3_credentials => "#{::Rails.root.to_s}/config/s3.yml",
       :url => :s3_domain_url.to_s,
       :path => "/:style/:id/:filename"
end
Run Code Online (Sandbox Code Playgroud)

有什么线索吗?我已经抓住了关于它的每一个主题,似乎没有任何工作......

谢谢

小智 19

显然,Cocaine gem(0.4.0)的新更新打破了Paperclip和ImageMagick的文件名.尝试回滚到之前的版本(0.3.2),它对我有用.

看这里:

https://github.com/thoughtbot/paperclip/issues/1038

PS我相信Heroku不再需要RMagick,没有它就能正常工作