Rosetta error

This error seems to arise for those using MacOS Ventura.

Solution: This solution is derived from this webpage, and is also described in this Piazza post.

  • Close RStudio.
  • Open a “terminal” window on your Mac (you can use the search tool to do this).
  • Install “brew” by copying and pasting this in your terminal window:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
  • then install “pandoc” by typing this in your terminal window:
brew install pandoc
  • if that’s successful, then open RStudio and type this in the command console:
Sys.setenv(RSTUDIO\_PANDOC="/opt/homebrew/bin")

Now you should be able to knit an RMD file to PDF!