Help Installing RStan

Short summary of the problem
Hi, I’m having issues installing RStan, I’m following Configuring C Toolchain for Windows · stan-dev/rstan Wiki · GitHub I have already installed RTools 3.5 and my code is copied from the link but I get the error (after running the first install.packages(“jsonlite”,type=“source”) under Install RTools):

C:/rtools40/usr/mingw_32/bin/gcc  -I"C:/PROGRA~1/R/R-40~1.5/include" -DNDEBUG -Iyajl/api       -D__USE_MINGW_ANSI_STDIO   -O2 -Wall  -std=gnu99 -mfpmath=sse -msse2 -mstackrealign -c base64.c -o base64.o
sh: line 1: C:/rtools40/usr/mingw_32/bin/gcc: No such file or directory
make: *** [C:/PROGRA~1/R/R-40~1.5/etc/i386/Makeconf:222: base64.o] Error 127
ERROR: compilation failed for package 'jsonlite'
* removing 'C:/Users/Josie/Documents/R/win-library/4.0/jsonlite'
* restoring previous 'C:/Users/Josie/Documents/R/win-library/4.0/jsonlite'
Warning in install.packages :
  installation of package ‘jsonlite’ had non-zero exit status
  • Operating System: Windows 10 64-bit

I would super appreciate any help getting this to work.

why don’t you try CmdStanR? install process is much simpler.
details here: Getting started with CmdStanR • cmdstanr

1 Like

Hi Josie,

It looks like you’re running R4.x, but you said that you’ve installed RTools 3.5. Try the instructions for R4.x instead: Configuring C Toolchain for Windows · stan-dev/rstan Wiki · GitHub