Quarto can't find Rscript.

Using 'render' on a .qmd document from within Rstudio on Windows I get the following error:

ERROR: Error executing 'C:\Users\XXX\scoop\apps\r\current\bin\Rscript': The system cannot find the file specified. (os error 2)

Unable to locate an installed version of R.
Install R from https://cloud.r-project.org/

This is true. This directory contains R.exebut not Rscript, however a subdirectory called ./x64/ contains Rscript.exe. If I copy Rscript.exe to this directory I instead get the following error on render:

ERROR: Error executing 'C:\Users\XXX\scoop\apps\r\current\bin\Rscript': The pipe is being closed. (os error 232)

Unable to locate an installed version of R.
Install R from https://cloud.r-project.org/

quarto::quarto_inspect() yields:

Error: lexical error: invalid char in json text.
                                       ERROR: . is not a quarto p
                     (right here) ------^

quarto::quarto_path() yields:


Rendering the same document with Rmarkdown (ie. changing the file extension to .Rmd) and again using the Rstudio "render" button works fine.

Based on a different thread here, I thought the problem may have been that the R project was on Onedrive, so I tried moving the project to my desktop and re-rendering it, but that didn't help.

R, Rtools and Rstudio are all downloaded using the scoop package manager. I believe that quarto docs rendered fine before I last updated Rstudio. The current Rstudio version is:

RStudio 2022.07.2+576 "Spotted Wakerobin" Release (e7373ef832b49b2a9b88162cfe7eac5f22c40b34, 2022-09-06) for Windows
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) QtWebEngine/5.12.8 Chrome/69.0.3497.128 Safari/537.36

For anyone who finds this in search:

I still don't really understand what happened or why it happened, but the following fixed the issue.

  • Install quarto independently thru scoop (eg. scoop install quarto)
  • Re-install quarto package thru Rstudio (eg. install.packages("quarto"))

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.