# Help Installing RStan

**URL:** <https://discourse.mc-stan.org/t/help-installing-rstan/22547>\
**Category:** RStan\
**Tags:** installation\
**Created:** [May 17, 2021, 2:52pm UTC](https://discourse.mc-stan.org/t/help-installing-rstan/22547 "2021-05-17T14:52:39Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![SquishySalsa](https://avatars.discourse-cdn.com/v4/letter/s/e9bcb4/32.png) [@SquishySalsa](https://discourse.mc-stan.org/u/SquishySalsa)\
**Post date:** [May 17, 2021, 2:52pm UTC](https://discourse.mc-stan.org/t/help-installing-rstan/22547/1 "2021-05-17T14:52:39Z")

</div>

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](https://github.com/stan-dev/rstan/wiki/Configuring-C---Toolchain-for-Windows) 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.

---

<div class="post-metadata">

**Author:** ![mitzimorris](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/mitzimorris/32/29_2.png) [@mitzimorris](https://discourse.mc-stan.org/u/mitzimorris)\
**Post date:** [May 17, 2021, 3:21pm UTC](https://discourse.mc-stan.org/t/help-installing-rstan/22547/2 "2021-05-17T15:21:25Z")

</div>

why don’t you try CmdStanR? install process is much simpler.  
details here: [Getting started with CmdStanR • cmdstanr](https://mc-stan.org/cmdstanr/articles/cmdstanr.html)

---

<div class="post-metadata">

**Author:** ![andrjohns](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/andrjohns/32/15297_2.png) [@andrjohns](https://discourse.mc-stan.org/u/andrjohns)\
**Post date:** [May 23, 2021, 6:31am UTC](https://discourse.mc-stan.org/t/help-installing-rstan/22547/4 "2021-05-23T06:31:21Z")

</div>

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](https://github.com/stan-dev/rstan/wiki/Configuring-C---Toolchain-for-Windows#r40)
