Here is my contribution to the multiple discussions about troubleshooting rstan on Windows.
I had been having serious issues with rstan runs failing with different incomprehensible errors, or even crashing RStudio. I tried all the recommendations (compiler flags, no PATH spaces, etc.). On a whim I tried digging around the .Rproj.user directory to see if there were any intelligible (say) log files etc. I was surprised to see hundreds of directories. Willing to be corrected, but I suspect each was due to a crash.
Be that what it may, I decided to scrap .Rproj.user and the project startup file, and remake the project. While I had to retweak some settings, mostly open tabs, suddenly the rstan calls ran fine right away.
I don’t understand what happened to the previous RStudio project, but wanted to share my experience for other Windows (and RStudio) users who may need another troubleshooting tool in the toolchest.