{"id":1696,"date":"2011-05-11T11:56:31","date_gmt":"2011-05-11T03:56:31","guid":{"rendered":"http:\/\/hazelong.com\/?p=1696"},"modified":"2011-05-08T19:57:27","modified_gmt":"2011-05-08T11:57:27","slug":"installing-image-magick-paperclip-centos-5","status":"publish","type":"post","link":"https:\/\/musenmaker.com\/hazelong\/?p=1696","title":{"rendered":"Installing Image Magick for Paperclip on Centos 5"},"content":{"rendered":"<p>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.<\/p>\n<p>Install Image Magick<\/p>\n<p>[shell]yum install gcc*[\/shell] Note that <code>yum install imagemagick<\/code> will not work on Centos properly.<\/p>\n<p>[shell]cd \/tmp[\/shell] Head to <code>ftp:\/\/ftp.fifi.org\/pub\/ImageMagick\/<\/code> and find out the latest release of the .tar.gz file.<\/p>\n<p>[shell]wget ftp:\/\/ftp.fifi.org\/pub\/ImageMagick\/ImageMagick-x-x-x-x.tar.gz[\/shell] This will download the files into the <code>tmp<\/code> folder. <\/p>\n<p>[shell]tar xzf ImageMagick-x.x.x-x.tar.gz<br \/>\ncd ImageMagick-x.x-x.tar.gz<br \/>\n.configure<br \/>\n[\/shell]<br \/>\nUntar the file and configure the installation.<\/p>\n<p>[shell]make<br \/>\nmake install[\/shell]<\/p>\n<p>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. <\/p>\n<p>It actually works so long as there is a link to the Imagemagick folder in the environment file. In <code>\/config\/environments\/production.rb<\/code> insert this code : [shell]  Paperclip.options[:command_path] = &#8220;\/usr\/local\/bin\/&#8221;[\/shell] The path may differ depending on the installation, to find out the full path, you can run this command. [shell] which convert[\/shell]<\/p>\n<p>Now in your <code>\/home\/demoapp\/public\/system<\/code> 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 <code>git<\/code> user if it is not working.<\/p>\n<p>After that restart apache and Paperclip uploads will work. <\/p>\n","protected":false},"excerpt":{"rendered":"<p>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&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1776],"tags":[1836,1850,1837,1851,1788],"class_list":["post-1696","post","type-post","status-publish","format-standard","hentry","category-coding-tutorials","tag-centos","tag-image-magick","tag-linux","tag-paperclip","tag-rails"],"acf":[],"_links":{"self":[{"href":"https:\/\/musenmaker.com\/hazelong\/index.php?rest_route=\/wp\/v2\/posts\/1696","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/musenmaker.com\/hazelong\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/musenmaker.com\/hazelong\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/musenmaker.com\/hazelong\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/musenmaker.com\/hazelong\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1696"}],"version-history":[{"count":0,"href":"https:\/\/musenmaker.com\/hazelong\/index.php?rest_route=\/wp\/v2\/posts\/1696\/revisions"}],"wp:attachment":[{"href":"https:\/\/musenmaker.com\/hazelong\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1696"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/musenmaker.com\/hazelong\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1696"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/musenmaker.com\/hazelong\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1696"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}