Paperclip::Errors::NotIdentifiedByImageMagickError on Windows 7

社会主义新天地 提交于 2019-11-29 00:43:38

I'm following the same course. After several gem changes (trying older versions of cocaine, etcetera...) the thing that solved my problem was adding this line to pin.rb:

Paperclip.options[:command_path] = 'C:/Program Files/ImageMagick-6.8.5-Q16'

before belongs_to :user

(change the path for your image magick install path)

After this, run a bundle update and reset your rails server.

erickuhn19

Add

Paperclip.options[:command_path] = 'C:/Program Files/ImageMagick-6.8.9-Q16'

to this file.

\config\environments\development.rb

Make sure to run

which convert

so you know what version number and don't copy and paste another version number.

Restart your rails server

Sangeeta Devni

Though it showed the path when I ran which convert, I download the ImageMagick and installed it separately and gave the path and added the line as mentioned by q256 and it worked!

I was using version 6.7.9 of ImageMagick. So in addition to adding the command_path, I had to update to the latest version of ImageMagick i.e 6.8.8

Just to expand on q256's answer, updating this file might cause it to break on heroku when you do a push, because the live-on-the-internet server won't know how to find a program installed on your local hard drive.

The more correct way (at least that I have found) to fix this issue for windows users is to update the development.rb file under config->environments->development.rb and throw the line in at the end of the file.

Paperclip.options[:command_path] = 'C:/Program Files/ImageMagick-6.8.5-Q16'

Hope that helps someone, and don't forget to restart your rails server after saving the file, note that a bundle update isn't required.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!