简体   繁体   English

无法在 R 中呈现四开本

[英]Unable to render quarto in R

Am using a Windows with R version 4.2.0 (2022-04-22 ucrt) and RStudio 2022.07.1 but unable to render https://quarto.org/docs/get-started/hello/rstudio.html file.我正在使用 Windows 和R version 4.2.0 (2022-04-22 ucrt)RStudio 2022.07.1但无法呈现https://quarto.org/docs/get-started/hello/rstudio708846751 file.86751 I get the error:我收到错误:

ERROR: Error executing 'reg': Access is denied. (os error 5)

Any leads?有线索吗?

If you get this error, it can indicate your Windows user profile doesn't give sufficient permissions.如果您收到此错误,则可能表明您的 Windows 用户配置文件没有提供足够的权限。

To solve, close RStudio, and instead of opening RStudio the usual way, right click the RStudio icon, and click ' Run as Administrator ', then try again.要解决,请关闭 RStudio,而不是按通常的方式打开 RStudio,右键单击 RStudio 图标,然后单击“ 以管理员身份运行”,然后重试。

Works well for me using RStudio 2022.02.3 Build 492 and R version 4.0.4 (2021-02-15) on Windows 10.在 ZAEA23489CE3AA9B6406EBB208 上使用RStudio 2022.02.3 Build 492R version 4.0.4 (2021-02-15)对我来说效果很好。

在此处输入图像描述

EDIT: the real issue is now that it won't work if the Project/File is in a path that has any spaces in it.编辑:现在真正的问题是,如果项目/文件位于包含任何空格的路径中,它将无法工作。 My organization installed OneDrive for everyone which changed our user paths from "C:\Users\First.LastName\Documents" to "C:\Users\First.LastName\OneDrive - Drive\Documents" Knit still works, but Render does not.我的组织为所有人安装了 OneDrive,这将我们的用户路径从“C:\Users\First.LastName\Documents”更改为“C:\Users\First.LastName\OneDrive - Drive\Documents” Knit 仍然有效,但 Render 不起作用。 My Solution is to use another directory such as "C:\R_Projects" to store my projects.我的解决方案是使用另一个目录(例如“C:\R_Projects”)来存储我的项目。 However, these wont get automatically backed up to my OneDrive unless I do something to add them.但是,这些不会自动备份到我的 OneDrive,除非我执行某些操作来添加它们。 I will not describe how to add them here.我不会在这里描述如何添加它们。

I am leaving the following even though it doesn't seem as relevant any more: Running as Admin does work, but here must be a way to fix this without Admin privileges as that is a serious security risk.我将保留以下内容,尽管它似乎不再相关:以管理员身份运行确实有效,但这里必须有一种方法可以在没有管理员权限的情况下解决此问题,因为这是一个严重的安全风险。 Thus far the answers don't indicate if you only have to run as admin once or if you always have to run as admin.到目前为止,答案并未表明您是否只需要以管理员身份运行一次,或者是否始终必须以管理员身份运行。 My testing seems to indicate it is always.我的测试似乎表明它总是如此。

The problem appears to be that something is blocking read of the source file for the render request.问题似乎是某些东西正在阻止读取渲染请求的源文件。 This occurs for R Markdown (Rmd) and Quarto (Qmd) rendering.这发生在 R Markdown (Rmd) 和 Quarto (Qmd) 渲染中。 I can still Knit rmd files.我仍然可以编织 rmd 文件。 I think it is caused by one of two things:我认为这是由以下两种情况之一引起的:

1- the Visual Editor system may be locking the file such that readlines() cannot open it 1- Visual Editor 系统可能正在锁定文件,导致 readlines() 无法打开它

2- the render process is trying to create a temp file in the "System Temp Directory" rather than the "user-space temp directory" Of course, there are other possibilities. 2-渲染进程试图在“系统临时目录”而不是“用户空间临时目录”中创建临时文件当然,还有其他可能性。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM