I am very new to R-studio and I am having a lot of trouble knitting my document. I just got a new computer (I have a macbook pro with an m2 chip) to use for my coding//stats class and it is giving me a lot of issues. The professor and a few other people don't know why this error is occurring.
sh: /Applications/RStudio.app/Contents/Resources/app/quarto/bin/tools/pandoc: Bad CPU type in executable Error in strsplit(info, "\n")[[1]] : subscript out of bounds Calls: ... pandoc_available -> find_pandoc -> lapply -> FUN -> get_pandoc_version In addition: Warning message: In system(paste(shQuote(path), "--version"), intern = TRUE) : running command ''/Applications/RStudio.app/Contents/Resources/app/quarto/bin/tools/pandoc' --version' had status 126 Execution halted.
I tried to run this pandoc_available - > find_pandoc -> lapply -> FUN -> get_pandoc_version but it did not solve the issue.
Re-install RStudioDesktop IDE which will give you either the Silicon version or the Rosetta version. It looks like you have the Intel version installed.
@technocrat RStudio Desktop installers have been universal installers for a while.
OTOH, the pandoc binary might be Intel, apparently, and the problem is that recently Apple does not include Rosetta in the OS. Run this from a terminal to install Rosetta, and then pandoc should work:
RStudio has bundled pandoc for a while. Now that it also bundles quarto and quarto needs pandoc anyway, it can just use pandoc from the embedded quarto.
And yeah, in the latest RStudio release pandoc is x86_64:
I had a fair amount of trouble last year and finally sorted it on my M1 with
Version 2023.03.0+386 (2023.03.0+386)
R version 4.3.0 (2023-04-21) -- "Already Tomorrow"
Copyright (C) 2023 The R Foundation for Statistical Computing
Platform: aarch64-apple-darwin20 (64-bit)
pandoc 3.1.6.2
Features: +server +lua
Scripting engine: Lua 5.4
.Renviron
RSTUDIO_PANDOC=/usr/local/bin/pandoc
RSTUDIO_QUARTO=/ usr/local/bin/quarto
and I've been hesitant to accept IDE updates since then. When I looked at the IDE code I got the impression that it was being tested on a VM rather than metal. There is an awful lot going on under the hood.