render with Quarto Error

I can render to HTML, The other functionality, like being about to use quarto_render() or rendering to formats other than HTML is not available.

Sorry it is not clear to me what is the real issue. I don't see how HTML would work but not other format.
Can you start fresh and share an example that works and don't works ?

quarto_render() will use a Quarto binary. Check that is is the same that you installed.

With the standard hello.qmd, and this YAML, renders to hello.html, not docx.

---
title: "Penguins, meet Quarto!"
format: 
    docx:
      toc: true
      section-numbers: true
      highlight-style: github

editor: visual
---

Process it with --to html4 even though I requested docx.



processing file: hello.qmd
  |..................                                                    |  25%
  ordinary text without R code

  |...................................                                   |  50%
label: load-packages (with options) 
List of 1
 $ include: logi FALSE

  |....................................................                  |  75%
   inline R code fragments

  |......................................................................| 100%
label: plot-penguins (with options) 
List of 2
 $ warning: logi FALSE
 $ echo   : logi FALSE


output file: hello.knit.md

"C:/Program Files/RStudio/bin/quarto/bin/pandoc" +RTS -K512m -RTS hello.knit.md --to html4 --from markdown+autolink_bare_uris+tex_math_single_backslash --output hello.html --lua-filter "C:\Users\hnelson3\AppData\Local\R\win-library\4.2\rmarkdown\rmarkdown\lua\pagebreak.lua" --lua-filter "C:\Users\hnelson3\AppData\Local\R\win-library\4.2\rmarkdown\rmarkdown\lua\latex-div.lua" --self-contained --variable bs3=TRUE --standalone --section-divs --template "C:\Users\hnelson3\AppData\Local\R\win-library\4.2\rmarkdown\rmd\h\default.html" --no-highlight --variable highlightjs=1 --variable theme=bootstrap --mathjax --variable "mathjax-url=https://mathjax.rstudio.com/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML" --include-in-header "C:\Users\hnelson3\AppData\Local\Temp\2\RtmpiEkd0c\rmarkdown-str2a5c27eb5a73.html" 

Output created: hello.html
Warning message:
Removed 2 rows containing missing values (geom_point). 
quarto::quarto_inspect()

yields:

Error in find_quarto() : Unable to find quarto command line tools.

Add

C:\Program Files\Quarto\bin

to the system path and restart RStudio

quarto::quarto_inspect()

yields

Error: lexical error: invalid char in json text.
The system cannot find the path
(right here) ------^

Now rendering does not work

The system cannot find the path specified.
The system cannot find the path specified.


processing file: hello.qmd
  |..................                                                    |  25%
  ordinary text without R code

  |...................................                                   |  50%
label: load-packages (with options) 
List of 1
 $ include: logi FALSE

  |....................................................                  |  75%
   inline R code fragments

  |......................................................................| 100%
label: plot-penguins (with options) 
List of 3
 $ warning: logi FALSE
 $ echo   : logi FALSE
 $ message: logi FALSE


output file: hello.knit.md

Warning message:
Removed 2 rows containing missing values (geom_point). 
The system cannot find the path specified.

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

Remove

C:\Program Files\Quarto\bin

from the system path and restart RStudio

Now rendering works again, but only to html as before.

The log you are sharing is the one from rmarkdown rendering. Quarto is not used.
How did you trigger the rendering of the file ? Do you have a Render button in the IDE ?
image

It seems Quarto is not found in your installation I don't know why. You need last version of RStudio. Do you have that ?

Also, can you check your Global option, and check the box if it is not set

Quarto is not found by RStudio in your environment at all. The HTML rendering works because it is rendered with R Markdown

RStudio 2022.02.2+485 "Prairie Trillium" Release (8acbd38b0d4ca3c86c570cf4112a8180c48cc6fb, 2022-04-19) for Windows
Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) QtWebEngine/5.12.8 Chrome/69.0.3497.128 Safari/537.36

I used the "Render" button in the "visual mode"

But you are correct about not find quarto because "file - new" does not give me an option for quarto.

There is something I do not quite understand is that the pandoc version used is the one from Quarto.
Quarto bin should be there too ... :thinking:

Would you be able to try a daily version to have a more recent environment ?
https://dailies.rstudio.com/

I still don't know if you have a clean environment now or not. If you have an environment variable still set,
that could mess up the detection

is this outputing something ?

Sys.getenv("QUARTO_CMD")

Same results. Also I did put and don't have quarto in my system path.

Sys.getenv("QUARTO_CMD")
[1] ""

Ok QUARTO CMD is on my side as I am using the dev version of quarto. Sorry for misleading.

I really don't know what is the issue. Quarto should be found by RStudio.

One other option is to install the MSI file for latest Quarto but it should be necessary as RStudio IDE bundles Quarto

Can you check

rmarkdown::find_pandoc()

and if it returns a path with quarto in it then run

list.files(dirname(rmarkdown::find_pandoc()$dir), recursive = TRUE)

thank you

rmarkdown::find_pandoc()
$version
[1] ‘2.18’

$dir
[1] "C:/Program Files/RStudio/bin/quarto/bin/tools"

> list.files(dirname(rmarkdown::find_pandoc()$dir), recursive = TRUE)
 [1] "quarto.cmd"                        "quarto.js"                        
 [3] "tools/dart-sass/sass.bat"          "tools/dart-sass/src/dart.exe"     
 [5] "tools/dart-sass/src/LICENSE"       "tools/dart-sass/src/sass.snapshot"
 [7] "tools/deno.exe"                    "tools/deno_dom/plugin.dll"        
 [9] "tools/esbuild.exe"                 "tools/pandoc.exe"                 

So this means that you correctly have quarto available within rstudio ide. I really don’t know what prevent this for working on your environnement.

You could try installing the msi release of quarto for a newer version and see if that changes something.

I’ll try to reproduce in a Fresh environnement next week.

Thanks,

This machine is running Windows Server 2012 R2 Standard. That might be some of the problem. My work laptop runs RStudio correctly and my Ubuntu machine at home also runs correctly. I think even my M1 does as well. So it is just this machine. It also doesn't run rtools42 either. I that is the problem I will see if the machine can be updated.

If this works on every other pomace that could be it. Thanks for the explanation.
Do you know how to run command In terminal ?

If so you could go into the folder where the bin is and then try to run it to see if there is a specific message. That would really help us.

If not, I’ll try to guide you next week for that.

Do you mean

hnelson3@ICWWOLFRAM01VG MINGW64 /c/Program Files/Quarto/bin
$ ./quarto.cmd
The system cannot find the path specified.

I was thinking on the path of the rstudio version you have printed above
Should be in

C:/Program Files/RStudio/bin/quarto/quarto.cmd

But don’t run that in bash. Probably better in CMD window terminal or powershell as you are on Windows.

    Directory: C:\Program Files\RStudio\bin\quarto\bin


Mode                LastWriteTime         Length Name
----                -------------         ------ ----
d-----        4/29/2022  12:38 PM                tools
-a----        4/11/2022   8:42 AM           2335 quarto.cmd
-a----        4/11/2022   8:43 AM        2966141 quarto.js


PS C:\Program Files\RStudio\bin\quarto\bin> .\quarto.cmd
The system cannot find the path specified.
PS C:\Program Files\RStudio\bin\quarto\bin>

Can you run

./quarto.cmd --version
PS C:\Program Files\RStudio\bin\quarto\bin> .\quarto.cmd
The system cannot find the path specified.
PS C:\Program Files\RStudio\bin\quarto\bin> ./quarto.cmd --version
The system cannot find the path specified.
0.9.230
PS C:\Program Files\RStudio\bin\quarto\bin>

So the command works for getting the version number, but I don't understand the previous error message.
Can you share again your OS information ? Where are you running R and Quarto ?

And can you share

> .\quarto.cmd --paths

It looks like the cmd code that is quarto.cmd is trying to call some other location that it can't find.
In general, I use RStudio. I now have both R and Quarto installed.