Skip to content

Instantly share code, notes, and snippets.

@kevinushey
Last active December 13, 2018 18:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kevinushey/e69365828b138d9270f7af94fdbb2932 to your computer and use it in GitHub Desktop.
Save kevinushey/e69365828b138d9270f7af94fdbb2932 to your computer and use it in GitHub Desktop.
Rtools not found in expected PATH
Sys.setenv(PATH = paste("C:\\RBuildTools\\3.5\\bin;C:\\RBuildTools\\3.5\\mingw_64\\bin", Sys.getenv("PATH"), sep = ";"))
file <- tempfile(fileext = ".c")
writeLines("void test() {}", con = file)
R <- file.path(R.home("bin"), "R")
file <- normalizePath(file, winslash = "/")
system2(R, c("CMD", "SHLIB", shQuote(file)))
# c:/Rtools/mingw_64/bin/gcc -I"C:/R/R-35~1.2BE/include" -DNDEBUG -O2 -Wall -std=gnu99 -mtune=generic -c C:/Users/kevin/AppData/Local/Temp/RtmpK2O0OE/file123830c41969.c -o C:/Users/kevin/AppData/Local/Temp/RtmpK2O0OE/file123830c41969.o
# sh: c:/Rtools/mingw_64/bin/gcc: No such file or directory
# make: *** [C:/R/R-35~1.2BE/etc/x64/Makeconf:208: C:/Users/kevin/AppData/Local/Temp/RtmpK2O0OE/file123830c41969.o] Error 127
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment