解决RStudio中的“未安装或未在PATH中的工具:ghostcript"警告 [英] Troubleshooting 'Tool(s) not installed or not in PATH: ghostcript' warning in RStudio

查看:134
本文介绍了解决RStudio中的“未安装或未在PATH中的工具:ghostcript"警告的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

警告消息

In has_crop_tools() : 
Tool(s) not installed or not in PATH: ghostcript
-> As a result, figure cropping will be disabled.

将简单的R Markdown文档编织为PDF时出现:

appears when a simple R Markdown document is knitted to PDF:

---
output: pdf_document
---

![foo](bar.png)

bar.png 图像可以嵌入到PDF中,但是看起来像是 ghostcript 命令中存在拼写错误(不应该是ghost <是否在 Ghostscript 解释器的名称之后添加"strong> s "?如何正确处理此警告消息?

The bar.png image is embedded into PDF all right, but it looks like there is a spelling error in called ghostcript command (shouldn't it be ghostscript after the name of Ghostscript interpreter?). How to properly address this warning message?

我的 xfun :: session_info()输出:

R version 4.0.4 (2021-02-15)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19042), RStudio 1.4.1103

Locale:
  LC_COLLATE=English_United States.1252  LC_CTYPE=English_United States.1252    LC_MONETARY=English_United States.1252
  LC_NUMERIC=C                           LC_TIME=English_United States.1252    

Package version:
  base64enc_0.1.3 compiler_4.0.4  digest_0.6.27   evaluate_0.14   glue_1.4.2      graphics_4.0.4  grDevices_4.0.4
  highr_0.8       htmltools_0.5.0 jsonlite_1.7.1  knitr_1.31      magrittr_2.0.1  markdown_1.1    methods_4.0.4  
  mime_0.9        rlang_0.4.10    rmarkdown_2.7   stats_4.0.4     stringi_1.5.3   stringr_1.4.0   tinytex_0.27   
  tools_4.0.4     utils_4.0.4     xfun_0.19       yaml_2.2.1   

推荐答案

您需要告诉R在哪里可以找到ghostscript.对于Windows,请从 http://ghostscript.com/download/gsdnld.html 下载ghostscript安装ghostscript之后,我们仍然需要告诉R在哪里可以找到ghostscript.为此,必须设置适应系统的Path变量:转到控制面板→系统和安全性→系统→高级系统设置→计算机名称,域和工作组设置→高级→环境变量在系统变量中找到路径变量,选择它,然后单击编辑.将C:\ Program Files \ gs \ gs9.23 \ bin(或将ghostscript安装到的目录)添加到Path变量.在Windows 10中,可以通过单击新建"并输入路径来执行此操作.在其他Windows版本中,只需将路径附加到以分号分隔的变量值上即可.重启R对于MacOS,请从 http://pages.uoregon.edu/koch/重新启动R

You need to tell R where to find ghostscript. For Windows, download ghostscript from http://ghostscript.com/download/gsdnld.html After installing ghostscript, we still need to tell R where to find ghostscript. To do so, it is necessary to set adapt your system’s Path variable: Go to Control Panel → System and Security → System → Advanced System Settings → computer name, domain and workgroup settings → Advanced → Environment Variables Find the Path variable within System Variables, select it and click on edit. Add C:\Program Files\gs\gs9.23\bin (or the directory where you installed ghostscript to) to the Path variable. In Windows 10, you can do this by clicking on New and entering the path. In other Windows versions, just append the path to the variable value, seperated by a semicolon. Restart R For MacOS, download and install the Ghostscript 9.23 package from http://pages.uoregon.edu/koch/ Restart R

我从此网站 https://rnbeads.org/data/installing_rnbeads.html

这篇关于解决RStudio中的“未安装或未在PATH中的工具:ghostcript"警告的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆