Error when trying to Compile PDF (knitr)

I am trying to compile the simplest possible example of a .Rnw file, but RStudio won't navigate to the correct pdflatex directory.

I'm using RStudio version 1.2.5042, R4.0, and MikTEX 2.9.7, on my Windows 10 machine.

I am able to compile the file using TEXworks without RStudio. Here's the document:



Hello World.


Here's the error:

Running pdflatex.exe on untitled-3.tex...failed
Error running C:/Users/gabe/AppData/Local/Programs/MIKTEX~1.9/miktex/bin/x64/pdflatex.exe (exit code 1)

I have found online help and tried EVERYTHING suggested. For example, I tried all of the ideas presented here:

I have also completely uninstalled and re-installed R, RStudio, and MikTEX.

Can anyone please help?

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