Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Windows R:grImport ghostscript error 'status 127'

I've installed Ghostscript and grImport in R (Windows, Rstudio). I'm following the tutorial but I immediately get the error,

> library(grImport)
Loading required package: grid
Loading required package: XML
> PostScriptTrace("petal.ps")
Error in PostScriptTrace("petal.ps") : 
  status 127 in running command 'gswin32c.exe -q -dBATCH -dNOPAUSE -sDEVICE=ps2write -sOutputFile=C:\Users\UsrNm\AppData\Local\Temp\RtmpsXXlWA\file1b5c623f48de -sstdout=petal.ps.xml capturepetal.ps'
In addition: Warning message:
running command 'gswin32c.exe -q -dBATCH -dNOPAUSE -sDEVICE=ps2write -sOutputFile=C:\Users\UsrNm\AppData\Local\Temp\RtmpsXXlWA\file1b5c623f48de -sstdout=petal.ps.xml capturepetal.ps' had status 127

Any help would be appreciated.

like image 469
noname Avatar asked Feb 07 '16 17:02

noname


1 Answers

I was having the same problem under Windows 10 and I solved it by manually setting the path to ghostscript:

Sys.setenv(R_GSCMD = normalizePath("C:/gs/gs9.20/bin/gswin32c.exe")) 
like image 52
Johan Larsson Avatar answered Nov 15 '22 07:11

Johan Larsson