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


74

我在Mountain Lion上并使用Homebrew安装了ImageMagick(minimagick也在我的Gemfile中,但我认为这无关紧要)。SimpleCaptcha在Rails应用程序中使用它来创建验证码。

但是,未创建图像是导致此错误的原因:

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.

有任何想法吗?

Answers:


161

好像您缺少ghostscript。如果您使用的是Homebrew,则可以通过以下方式安装:

$ brew install ghostscript

3
有时您有ghostscript,但没有链接! $ brew unlink ghostscript && brew link ghostscript
Gant Laborde 2014年

9
当错误消息未指定丢失的字体时,这也可以工作,例如convert: unable to read font `(null)' @ error/annotate.c/RenderFreetype/1153
LeEnno 2015年

1
有没有人需要Windows帮助?
Rishabh Agrawal'4

By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.