我正在尝试将回形针与Heroku和亚马逊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.当我在我的模型中删除了:styles => {}选项,但文件没有被处理(我需要不同的图像大小)时,它就会起作用。
我的gemfile中也有rmagick gem。
这是我的gemfile (只有回形针部分):
gem "paperclip"
gem "rmagick", :require => 'RMagick'
gem 'aws-sdk', '~> 1.3.4'我没有在我的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有什么线索吗?我已经搜索了所有关于它的话题,但似乎什么都不起作用……
谢谢
发布于 2012-10-06 22:58:00
显然,可卡因gem的新更新(0.4.0)打破了回形针和ImageMagick的文件名。尝试回滚到以前的版本(0.3.2),它对我有效。
请看这里:
https://github.com/thoughtbot/paperclip/issues/1038
附言:我相信在Heroku上不再需要RMagick了,没有它对我来说很好
https://stackoverflow.com/questions/12750737
复制相似问题