Quick Tip – Getting Paperclip to work on Windows

Nowadays Windows feels like Ubuntu a few years ago, without some hacks and tweaks, it can’t run many awesome stuff by default. If you use Ruby and Paperclip gem, you may have realized that the default gem doesn’t work because of issues with ImageMagick. To fix this, you need a little hack like the one below:

1. go to ImageMagick official website, download and install the latest Windows release of ImageMagick
2. create paperclip.rb in your /config/initializers/
3. enter the following lines in the file, remember to replace ‘ImageMagick-6.7.6-3-Q16′ with the version you have downloaded.

require "paperclip"

Paperclip.options[:command_path] = 'C:\Program Files\ImageMagick-6.7.6-3-Q16'
Paperclip.options[:swallow_stderr] = false

And now Paperclip should be working just like the way it does on Mac/Linux :)

Be Sociable, Share!

About Shi Chuan

I am a web developer.
This entry was posted in Ruby and tagged , . Bookmark the permalink.

12 Responses to Quick Tip – Getting Paperclip to work on Windows

  1. tjd says:

    ‘ll show you what it worked for us:

    There is a name conflict with “convert” command. Paperclips tries to run “convert” as is, but this command is already included in the Windows installations as a filesystem converter (FAT to NTFS or something).

    If you try to run “convert” from command line, probably will run the mentioned converter instead of imagemagick’s “convert” It depends on the PATH environment variable.

    If we set imagemagick’s path FIRST in the PATH variable it will resolve this path first, so the windows’ command won’t be executed.

    In order to fix it on our rails application, we added

    … if Sys::Uname.sysname == “Linux” … else …. ENV[‘PATH’] = Paperclip.options[:command_path] + “;” + ENV[‘PATH’] end …

    on production.rb

    • Rahul says:

      ‘ENV[‘PATH’] = Paperclip.options[:command_path] + “;” + ENV[‘PATH’]’

      This was what eventually helped me. Thanks

  2. Magnificent beat ! I would like to apprentice at the same time as you amend your website, how can i subscribe for a weblog web site? The account helped me a appropriate deal. I had been a little bit acquainted of this your broadcast provided vivid transparent idea

  3. akshay says:

    hey, thanks for this awesome hack. but how to specify the image magick path on the production server..i’m using rails 3 and deploying on heroku..how do i to this same stuff on heroku production sever..cheers..

  4. fake coach on sale now, although the price here is cheap but we guarantee the quality is in the highest level.
    fake coach here discount in 50-70% off. Free shipping for you.

    more from:cheap replica coach

  5. Tim says:

    Ah.. outstanding – that solved my issue at a stroke. Many many thankyou’s..

  6. arcament.net says:

    If your ISP enables you to use legal torrents, then you should not be concerned about utilizing the technology a more than need to be worried about typing from a website with your address bar on your browser.

  7. and arrow keys on your keyboard to activate these links ?’);return false” onmouseout=”hideBubbleTip()” >Rockwell masterpieces at NYC… ISHPEMING – Due to her 47 years of service as both an employee and proprietor of Lawry’s Pasty Shop, Nancy Lawry Cope’s name is largely synonymous with one of the Upper Peninsula’s most beloved foods. However, Lawry was much more than just a business owner. She was also the first woman to receive her pilot’s license from the old Marquette airport. Back in 1966,

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>