Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Paperclip cannot find ImageMagick on AWS Elastic Beanstalk

I'm running rails 4.1 and paperclip 4.2, after I deploy to AWS Elastic Beanstalk I cannot save files with paperclip to S3, I am getting an error:

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.>

Any ideas? How do I install ImageMagick to ELB?

like image 500
ecoding5 Avatar asked Oct 03 '14 00:10

ecoding5


1 Answers

Turns out, you can SSH into your EC2 instance and install ImageMagick manually, the caveat is that manual changes will not persist if there are updates to the instance itself. The best way to do this is to create an .ebextensions folder and add a config file. Something that looks like this:

packages:
  yum:
    ImageMagick-devel: []

Also, your .ebextensions should not be in your gitignore.

like image 127
ecoding5 Avatar answered Nov 14 '22 22:11

ecoding5