'ImageMagick: Error while running convert: convert: unable to read font

I'm on Mountain Lion and installed ImageMagick using Homebrew (minimagick is also in my Gemfile but I don't think that's relevant). SimpleCaptcha uses it in a Rails app to create CAPTCHAs.

However, the image isn't created cause of this error:

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.

Any ideas?



Solution 1:[1]

Looks like you're missing ghostscript. If you are using Homebrew you can install it via:

$ brew install ghostscript

Solution 2:[2]

if you are using Ubuntu or in a docker with Ubuntu remove and reinstall ghostscript package will fix your issue

apt remove ghostscript
apt install ghostscript

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Glorfindel
Solution 2