Many projects require the use of Image Magick to automatically resize and generate thumbnails for their applications. Recently, I have set up my server to house Rails applications and the next steps would be to install Image Magick and also a mail server to handle emails.
Install Image Magick
[shell]yum install gcc*[/shell] Note that
yum install imagemagick will not work on Centos properly.
[shell]cd /tmp[/shell] Head to
ftp://ftp.fifi.org/pub/ImageMagick/ and find out the latest release of the .tar.gz file.
[shell]wget ftp://ftp.fifi.org/pub/ImageMagick/ImageMagick-x-x-x-x.tar.gz[/shell] This will download the files into the
[shell]tar xzf ImageMagick-x.x.x-x.tar.gz
Untar the file and configure the installation.
After this I realized that I actually need the RMagick gem. However in my local machine I did not install this and Paperclip works just fine. I am just gonna omit the RMagick gem and see how things goes.
It actually works so long as there is a link to the Imagemagick folder in the environment file. In
/config/environments/production.rb insert this code : [shell] Paperclip.options[:command_path] = “/usr/local/bin/”[/shell] The path may differ depending on the installation, to find out the full path, you can run this command. [shell] which convert[/shell]
Now in your
/home/demoapp/public/system folder, you have to ensure that it has proper permission so that Paperclip can write to it. You may need to change ownership to the
git user if it is not working.
After that restart apache and Paperclip uploads will work.