MacOS – After Yosemite, can’t print; CUPS error_log: “/bin/bash: gs: command not found”

cupsenvironment-variablesmacosprinting

My printer stopped working since I upgraded to Yosemite. The print queue window says only "Stopped – 'Filter' failed". From /var/log/cups/error_log:

...
D [28/Oct/2014:21:46:49 -0700] [Job 4] PID 3334 (/usr/libexec/cups/filter/cgpdftops) exited with no errors.
D [28/Oct/2014:21:46:49 -0700] [Job 4] Wrote 1 pages...
D [28/Oct/2014:21:46:49 -0700] [Job 4] PID 3335 (/usr/libexec/cups/filter/pstops) exited with no errors.
D [28/Oct/2014:21:46:49 -0700] [Job 4] Flushing FIFO.
D [28/Oct/2014:21:46:49 -0700] [Job 4] Starting renderer with command: "gs -dBATCH -dPARANOIDSAFER -dNOPAUSE -sDEVICE=pxlmono -r600x600 -dMediaPosition=0 -dDEVICEWIDTHPOINTS=612 -dDEVICEHEIGHTPOINTS=792 -sOutputFile=/dev/fd/3 -_ 3>&1 1>&2"
D [28/Oct/2014:21:46:49 -0700] [Job 4] Starting process "kid3" (generation 1)
D [28/Oct/2014:21:46:49 -0700] [Job 4] Starting process "kid4" (generation 2)
D [28/Oct/2014:21:46:49 -0700] [Job 4] JCL: -12345X@PJL
D [28/Oct/2014:21:46:49 -0700] [Job 4] <job data> 
D [28/Oct/2014:21:46:49 -0700] [Job 4] Starting process "renderer" (generation 2)
D [28/Oct/2014:21:46:49 -0700] [Job 4] /bin/bash: gs: command not found
D [28/Oct/2014:21:46:49 -0700] [Job 4] renderer exited with status 127
D [28/Oct/2014:21:46:49 -0700] [Job 4] Closing renderer
D [28/Oct/2014:21:46:49 -0700] [Job 4] kid3 exited with status 1
D [28/Oct/2014:21:46:49 -0700] [Job 4] Process is dying with "Error closing renderer
D [28/Oct/2014:21:46:49 -0700] [Job 4] ", exit stat 1
D [28/Oct/2014:21:46:49 -0700] [Job 4] Cleaning up...
D [28/Oct/2014:21:46:49 -0700] [Job 4] PID 3336 (/usr/libexec/cups/filter/foomatic-rip) stopped with status 1.
D [28/Oct/2014:21:46:49 -0700] [Job 4] Hint: Try setting the LogLevel to "debug" to find out more.
D [28/Oct/2014:21:46:49 -0700] [Job 4] Sent 0 bytes...
D [28/Oct/2014:21:46:49 -0700] [Job 4] STATE: +cups-waiting-for-job-completed
D [28/Oct/2014:21:46:49 -0700] [Job 4] Waiting for read thread to exit...
D [28/Oct/2014:21:46:49 -0700] [Job 4] PID 3337 (/usr/libexec/cups/backend/usb) exited with no errors.
D [28/Oct/2014:21:46:49 -0700] [Job 4] End of messages
D [28/Oct/2014:21:46:49 -0700] [Job 4] printer-state=3(idle)
D [28/Oct/2014:21:46:49 -0700] [Job 4] printer-state-message="Filter failed"
D [28/Oct/2014:21:46:49 -0700] [Job 4] printer-state-reasons=none

/bin/bash: gs: command not found looks interesting, as does PID 3336 (/usr/libexec/cups/filter/foomatic-rip) stopped with status 1. I assume the first error led to the second.

GhostScript has long been installed. I just installed the latest (9.15). Running gs in Terminal launches the GhostScript command line tool. which gs tells me /usr/local/bin/gs.

I tried restarting CUPS (sudo launchctl [stop/start] org.cups.cupsd). I also symlinked gs to /usr/bin and /sbin.

Why can't it find gs when I actually try to print?

Best Answer

If you look in your console, you'll probably see a message about sandboxd preventing gs from running. Just add this line to the end of /etc/cups/cups-files.conf:

Sandboxing Relaxed

then type:

sudo launchctl stop org.cups.cupsd