From ghostscript-gpl's doc/Issues.htm:
When pdfwrite device cannot open the output file it fails with:
**** Unable to open the initial device, quitting.
(Device here means gs's option -sDEVICE=[...].)
So you can easily reproduce that error by invoking e.g. ps2pdf or
pdf2ps from a non-writable directory. Or try not to specify
-sOutputFile, like this:
% gs -sDEVICE=pswrite abc.pdf (even in a writable directory)
% gs -sDEVICE=pdfwrite abc.ps
and you will get the same error. Finally, you can try
% gs -sDEVICE=pswrite -dNOPAUSE -dBATCH \
-sOutputFile=/writable-dir/abc.ps abc.pdf
and check if gs is able to write its temporary file.
Possible workaround: try to set TEMP and/or TMPDIR to something
writable (e.g. /tmp) in your environment.