# Rstan problem

**URL:** <https://discourse.mc-stan.org/t/rstan-problem/22571>\
**Category:** General\
**Tags:** rstan, fitting-issues\
**Created:** [May 18, 2021, 3:33pm UTC](https://discourse.mc-stan.org/t/rstan-problem/22571 "2021-05-18T15:33:07Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![WTnicole\_WTnicole](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/wtnicole_wtnicole/32/11698_2.png) [@WTnicole\_WTnicole](https://discourse.mc-stan.org/u/WTnicole_WTnicole)\
**Post date:** [May 18, 2021, 3:33pm UTC](https://discourse.mc-stan.org/t/rstan-problem/22571/1 "2021-05-18T15:33:07Z")

</div>

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

```

---

<div class="post-metadata">

**Author:** ![Ara\_Winter](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/ara_winter/32/4284_2.png) [@Ara\_Winter](https://discourse.mc-stan.org/u/Ara_Winter)\
**Post date:** [May 18, 2021, 3:42pm UTC](https://discourse.mc-stan.org/t/rstan-problem/22571/2 "2021-05-18T15:42:40Z")

</div>

Morning,

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?

Thanks!

---

<div class="post-metadata">

**Author:** ![WTnicole\_WTnicole](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/wtnicole_wtnicole/32/11698_2.png) [@WTnicole\_WTnicole](https://discourse.mc-stan.org/u/WTnicole_WTnicole)\
**Post date:** [May 18, 2021, 3:59pm UTC](https://discourse.mc-stan.org/t/rstan-problem/22571/3 "2021-05-18T15:59:05Z")

</div>

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

locale:  
[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

---

<div class="post-metadata">

**Author:** ![WTnicole\_WTnicole](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/wtnicole_wtnicole/32/11698_2.png) [@WTnicole\_WTnicole](https://discourse.mc-stan.org/u/WTnicole_WTnicole)\
**Post date:** [May 18, 2021, 4:01pm UTC](https://discourse.mc-stan.org/t/rstan-problem/22571/4 "2021-05-18T16:01:27Z")

</div>

Rstan version rstan\_2.21.2

---

<div class="post-metadata">

**Author:** ![WTnicole\_WTnicole](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/wtnicole_wtnicole/32/11698_2.png) [@WTnicole\_WTnicole](https://discourse.mc-stan.org/u/WTnicole_WTnicole)\
**Post date:** [May 19, 2021, 10:39am UTC](https://discourse.mc-stan.org/t/rstan-problem/22571/5 "2021-05-19T10:39:17Z")

</div>

Hi sir, Do you have any idea? @andrjohns

---

<div class="post-metadata">

**Author:** ![WTnicole\_WTnicole](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/wtnicole_wtnicole/32/11698_2.png) [@WTnicole\_WTnicole](https://discourse.mc-stan.org/u/WTnicole_WTnicole)\
**Post date:** [May 20, 2021, 7:57pm UTC](https://discourse.mc-stan.org/t/rstan-problem/22571/6 "2021-05-20T19:57:22Z")

</div>

when will they can help me?

---

<div class="post-metadata">

**Author:** ![Ara\_Winter](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/ara_winter/32/4284_2.png) [@Ara\_Winter](https://discourse.mc-stan.org/u/Ara_Winter)\
**Post date:** [May 20, 2021, 9:49pm UTC](https://discourse.mc-stan.org/t/rstan-problem/22571/7 "2021-05-20T21:49:40Z")

</div>

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.
