Rstan problem

I download the rstan, and run the 8 schools model, i got the following errors:

Error in compileCode(f, code, language = language, verbose = verbose) : 
  sh: line 1: C:/rtools40/usr/mingw_64/bin/g++: No such file or directorymake: *** [C:/PROGRA~1/R/R-40~1.5/etc/x64/Makeconf:229: file5187d5c59e0.o] Error 127
In addition: Warning message:
In system(paste(CXX, ARGS), ignore.stdout = TRUE, ignore.stderr = TRUE) :
  'C:/rtools40/usr/mingw_/bin/g++' not found
Error in sink(type = "output") : invalid connection


A couple of things that will help folks troubleshoot:
Can you post your OS and version?
What version of rstan, R, and RStudio (if you are using it) you have installed?


1 Like

I use Rstudio Version 1.3.1073 (Windows)

R version 4.0.5 (2021-03-31)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 18363)

Matrix products: default

[1] LC_COLLATE=English_United States.1252 LC_CTYPE=English_United States.1252 LC_MONETARY=English_United States.1252
[4] LC_NUMERIC=C LC_TIME=English_United States.1252

attached base packages:
[1] stats graphics grDevices utils datasets methods base

loaded via a namespace (and not attached):
[1] Rcpp_1.0.5 compiler_4.0.5 pillar_1.6.1 prettyunits_1.1.1 tools_4.0.5
[6] pkgbuild_1.2.0 jsonlite_1.7.2 lifecycle_1.0.0 tibble_3.0.3 gtable_0.3.0
[11] pkgconfig_2.0.3 rlang_0.4.11 cli_2.5.0 rstudioapi_0.13 parallel_4.0.5
[16] curl_4.3 xfun_0.23 loo_2.4.1 gridExtra_2.3 dplyr_1.0.6
[21] withr_2.4.2 generics_0.1.0 vctrs_0.3.8 tidyselect_1.1.0 stats4_4.0.5
[26] grid_4.0.5 inline_0.3.18 glue_1.4.1 R6_2.4.1 processx_3.5.2
[31] fansi_0.4.1 rstan_2.21.2 purrr_0.3.4 ggplot2_3.3.3 callr_3.7.0
[36] magrittr_1.5 codetools_0.2-18 matrixStats_0.56.0 scales_1.1.1 ps_1.6.0
[41] StanHeaders_2.21.0-7 ellipsis_0.3.2 colorspace_2.0-1 utf8_1.1.4 V8_3.4.2
[46] tinytex_0.31 RcppParallel_5.1.4 munsell_0.5.0 crayon_1.3.4

1 Like

Rstan version rstan_2.21.2

Hi sir, Do you have any idea? @andrjohns

when will they can help me?

I am not sure. I don’t have access to a Windows machine. But I can search the forums for a similar error and see if it was solved.