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

ruby-on-rails – Paperclip在AWS Elastic Beanstalk上找不到Ima

发布时间:2020-12-17 03:24:04 所属栏目:百科 来源:网络整理
导读:我正在运行rails 4.1和paperclip 4.2,在我部署到AWS Elastic Beanstalk之后我无法使用paperclip将文件保存到S3,我收到一个错误: Command :: file -b --mime '/tmp/308f17f99f5a4157c8839634d039b1c620141002-22818-7crhx4.jpg'Command :: identify -format
我正在运行rails 4.1和paperclip 4.2,在我部署到AWS Elastic Beanstalk之后我无法使用paperclip将文件保存到S3,我收到一个错误:

Command :: file -b --mime '/tmp/308f17f99f5a4157c8839634d039b1c620141002-22818-7crhx4.jpg'
Command :: identify -format '%wx%h,%[exif:orientation]' '/tmp/308f17f99f5a4157c8839634d039b1c620141002-22818-xo8669.jpg[0]' 2>/dev/null
[paperclip] An error was received while processing: #<Paperclip::Errors::CommandNotFoundError: Could not run the `identify` command. Please install ImageMagick.>

有任何想法吗?如何将ImageMagick安装到ELB?

解决方法

事实证明,您可以通过SSH连接到EC2实例并手动安装ImageMagick,但需要注意的是,如果实例本身有更新,手动更改将不会持续存在.执行此操作的最佳方法是创建.ebextensions文件夹并添加配置文件.看起来像这样的东西:

packages:
  yum:
    ImageMagick-devel: []

此外,您的.ebextensions不应该在您的gitignore中.

(编辑:李大同)

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

    推荐文章
      热点阅读