knit does not find xfun

I'm trying to knit an Rmd document to html in RStudio under Windows 10 (which I never had problems with before ...). Suddenly, RStudio keeps saying that an updated version of the package "xfun" has to be installed. Agreeing to that results in the following output:

There is a binary version available but the source version is later:
binary source needs_compilation
xfun 0.13 0.25 FALSE

installing the source package ‘xfun’

trying URL ''
Content type 'application/x-gzip' length 112755 bytes (110 KB)
downloaded 110 KB

  • installing source package 'xfun' ...
    ** package 'xfun' successfully unpacked and MD5 sums checked
    ** libs

*** arch - i386
c:/Rtools/mingw_32/bin/gcc -I"C:/PROGRA~1/R/R-35~1.0/include" -DNDEBUG -O3 -Wall -std=gnu99 -mtune=generic -c base64.c -o base64.o
sh: line 1: c:/Rtools/mingw_32/bin/gcc: No such file or directory
make: *** [C:/PROGRA~1/R/R-35~1.0/etc/i386/Makeconf:208: base64.o] Error 127
ERROR: compilation failed for package 'xfun'

  • removing 'C:/Users/Uwe/Documents/R/win-library/3.5/xfun'
  • restoring previous 'C:/Users/Uwe/Documents/R/win-library/3.5/xfun'
    Warning in install.packages :
    installation of package ‘xfun’ had non-zero exit status

If I type "library(xfun)" the package is loaded. (I installed a binary version as RStudio notes).
I noticed that the file c:/Rtools/mingw_32/bin/gcc does not exist.
The correct path is C:\rtools40\mingw32\bin\gcc
How can I tell RStudio the correct path??

RTools40 is meant to be used with R >=4.0.0, you can't use it with R 3.5, you need to install a matching version of RTools, you can download older versions from here

Although, I would recommend updating your R version

Thanks a lot, andresrcs, updating R (and RStudio) solved the problem.

This topic was automatically closed 21 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.