RStanArm working, but RStan is unable to find C++ compiler


Strange situation. I have tried running the code from the RStanArm Vignette here: and everything runs fine. Also, when I try to use: devtools::find_rtools(TRUE), it returns TRUE, so I know that RTools is present and I do have a C++ compiler working in my system.

However, when I was trying to specify my own stan model with the command below, I get a message that says
"No C++ compiler found, so the following will probably not work."

I am unable to do a reinstall at the moment, because I do not have admin privileges on this device (work computer). Any advice would be much appreciated!

data = list(“X”, “Y”, “N”, “Z”),
iter = 2000, chains = 4)


The rstanarm models are precompiled so that’s probably why those run fine. Unfortunately, it’s possible that even with RTools installed the compiler won’t be found. What does Sys.getenv('PATH') path return?

Have you looked at the information at the link below?

It gives a few suggestions for checking that your setup is correct.


Sys.getenv(‘PATH’) does not get me the expected folder with RTools.


What does




I get this:


Okay that means it has no idea where g++ is. Where did you install RTools to?