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 :)

Share and Enjoy:
  • Print
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • Technorati
  • Twitter
  • Yahoo! Bookmarks

About Shi Chuan

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

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

  1. Durburbance says:

    Любите автомобили? Желаете не совершить ошибку в выборе? значит вы должны быть в курсе выпускаемых новинок. Новости авто, выложенные на сайте http://carplace.net/, смогут помочь вам разобраться с выбором автомобиля. Прежде чем покупать автомобиль, ознакомьтесь с автоновостями, чтобы остановиться на верном решении!

  2. Интернет сайт http://upmobile.org/, который посвящен играм и софту для сотовых телефонов. Вы обязательно сможете выбрать игру под ваш телефон, не зависимо от размера экрана.

  3. nortielptet says:

    Огромный выбор бесплатных игр на компьютер, возможность скачать без регистрации и смс. Полные версии игр с переводом на русский язык, гонки, скачать игру Angry Birds Space бесплатно, стрелялки, стратегии и мини игры, рейтнг лучших игр за месяц и многое другое.

  4. Viarlignatt says:

    Браузер google chrome, научился управлять микрофонами, веб-камерами и игровыми контроллерами без помощи дополнительных плагинов. Расширенную функциональность программы обеспечивает поддержка двух новых API (интерфейсов прикладного программирования), сообщается в блоге компании.

  5. Jeapkneeria says:

    на этом веб-блоге http://rapportal.net/ подобран большой выбор рэп-релизов для скачивания.

  6. Jeapkneeria says:

    здесь на веб-сайте http://rapportal.net/ вы можете посмотреть большой выбор рэп-альбомов доступных для скачивания.

  7. LoanyHacy says:

    Достаточно просто посмотреть на любую фотку Анджелины Джоли на портале http://angelinajolie.name/, для того чтобы навсегда запомнить иполюбить ее. Она разная, удивительная и особая женщина, которая просто неспособна остаться незамеченной. Неважно, в какой картине, и какую роль она играет: ее талант, эксклюзивность, и харизма, покоряют уже с первого кадра. Она личность, в первую очередь, неповторимая и яркая, как никто другой.

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

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

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> <pre lang="" line="" escaped="" highlight="">