小编Loï*_*ant的帖子

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

我正在努力让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" …
Run Code Online (Sandbox Code Playgroud)

ruby-on-rails imagemagick heroku amazon-s3 paperclip

9
推荐指数
1
解决办法
5305
查看次数