Paperclip在AWS Elastic Beanstalk上找不到ImageMagick

时间:2014-10-03 00:04:48

标签: ruby-on-rails amazon-web-services amazon-s3 paperclip

我运行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 个答案:

答案 0 :(得分:7)

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

packages:
  yum:
    ImageMagick-devel: []

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