Paperclip在AWS Elastic Beanstalk上找不到ImageMagick。

5

我正在使用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上?
1个回答

7
原来,您可以通过SSH登录到EC2实例并手动安装ImageMagick,但是需要注意的是,如果实例本身有更新,则手动更改不会持久保存。 最好的方法是创建一个.ebextensions文件夹并添加一个配置文件。如下所示:
packages:
  yum:
    ImageMagick-devel: []

此外,您的.ebextensions文件不应该被添加到gitignore中。

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接