加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

ruby-on-rails – “识别”命令无法识别图像文件. (Heroku的)

发布时间:2020-12-16 22:06:41 所属栏目:百科 来源:网络整理
导读:我试图让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 recog
我试图让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.

当我删除:styles => {}选项,但该文件未被处理(我需要不同的图像大小).

我的gemfile中也有rmagick宝石.

这是我的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

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

谢谢

解决方法

显然,可卡因宝石(0.4.0)的新更新中断了Paperclip和ImageMagick的文件名.尝试回滚到以前的版本(0.3.2),它为我工作.

看这里:

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

PS我相信,在没有它的情况下,对于我来说,RMagick已经不再需要了,

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读