ImageMagick:运行convert时出错:convert:无法读取字体

Agi*_*gis 74 imagemagick osx-mountain-lion

我在Mountain Lion上使用Homebrew安装了ImageMagick(minimagick也在我的Gemfile中,但我不认为这是相关的).SimpleCaptcha在Rails应用程序中使用它来创建CAPTCHA.

但是,图像不会导致此错误:

Error while running convert: convert: unable to read font `/usr/local/share/ghostscript/fonts/n019003l.pfb' @ error/annotate.c/RenderFreetype/1123.
convert: Postscript delegate failed `/var/folders/gd/n7rzfhkd5jd0ws8jnzsz34hr0000gn/T/magick-vzHHz4ZP': No such file or directory @ error/ps.c/ReadPSImage/830.
convert: no images defined `/var/folders/gd/n7rzfhkd5jd0ws8jnzsz34hr0000gn/T/simple_captcha20121218-64930-1thtfpf.jpg' @ error/convert.c/ConvertImageCommand/3032.
Run Code Online (Sandbox Code Playgroud)

有任何想法吗?

cfe*_*uke 161

看起来你错过了ghostscript.如果您使用的是Homebrew,可以通过以下方式安装:

$ brew install ghostscript
Run Code Online (Sandbox Code Playgroud)

  • 当错误消息没有指定丢失的字体时,这也有效,如`convert:could to read font \`(null)'@ error/annotate.c/RenderFreetype/1153` (9认同)
  • 有时你有ghostscript但它没有链接!`$ brew unlink ghostscript && brew链接ghostscript` (3认同)