Error in prep_call_sampler(object)

I’m trying to run the code from here. This was working for me before, yet I was suggested to upgrade to R.4.0 and so I did. My current version of R is 4 and my Rstudio is Version 1.2.5. However, now that I am running this part of the code:

> test = stan("SI_fit.stan",
+             data = stan_d,
+             pars = params_monitor,
+             chains = 1, iter = 10)

I get:

Error in prep_call_sampler(object) : 
  could not find function "prep_call_sampler"

I looked this up and it seems prep_call_sampler is a function of rstan so it must be installed with rstan. To install rstan I tried:
install.packages("rstan", dependencies = TRUE)
and on both methods, I get the error! I wonder what is going wrong here? Note that I am using MacOs Catalina.

Another note, when I run file.edit("~/.Renviron") on R I get this:

# clang: start


# clang: end

which I am not sure what I should do with it. This seems to be important in here.

You need to delete that line from ~/.Renviron, but it seems there might be other problems as well.