Rails Paperclip::NotIdentifiedByImageMagickError 错误解决
2011年06月01日
# 1.先安装 ImageMagick: http://www.imagemagick.org/script/binary-releases. php#windows# 2.创建 initializers 文件:config/initializers/paperclip.rb 存入下面的代码# 3.重启 webserver# 设置 command_path ,请将 c:/program files/imagemagick-6.5.5-Q16 改为你的 ImageMagick 的安装目录Paperclip.options[:command_path]="c:/program files/imagemagick-6.5.5-Q16"Paperclip.options[:swallow_stderr]=falsedefruncmd,params="",expected_outcodes=0command=%Qcommand="#{command} 2>#{bit_bucket}"ifPaperclip.options[:swallow_stderr]output=`#{command}`unless[expected_outcodes].flatten.include?($?.exitstatus)raisePaperclipCommandLineError,"Error while running #{cmd}"endoutputend
2011年06月01日
# 1.先安装 ImageMagick: http://www.imagemagick.org/script/binary-releases. php#windows# 2.创建 initializers 文件:config/initializers/paperclip.rb 存入下面的代码# 3.重启 webserver# 设置 command_path ,请将 c:/program files/imagemagick-6.5.5-Q16 改为你的 ImageMagick 的安装目录Paperclip.options[:command_path]="c:/program files/imagemagick-6.5.5-Q16"Paperclip.options[:swallow_stderr]=falsedefruncmd,params="",expected_outcodes=0command=%Qcommand="#{command} 2>#{bit_bucket}"ifPaperclip.options[:swallow_stderr]output=`#{command}`unless[expected_outcodes].flatten.include?($?.exitstatus)raisePaperclipCommandLineError,"Error while running #{cmd}"endoutputend