Troubles installing the developer version of 'rstanarm' on M1 Apple


I would like to use the stan_survival function but I have troubles installing the rstanarm developer version.

I tried

Sys.setenv(MAKEFLAGS = "-j2")
remotes::install_github("stan-dev/rstanarm", INSTALL_opts = "--no-multiarch", force = TRUE)

but it says:
“Error: Failed to install ‘rstanarm’ from GitHub:
System command ‘R’ failed, exit status: 1, stdout & stderr were printed”

I also tried:

install.packages("rstanarm", repos = c("", getOption("repos")))

but receive the following message:

Warning in install.packages :
unable to access index for repository
cannot open URL ‘
trying URL ‘
Content type ‘application/x-gzip’ length 43380289 bytes (41.4 MB)

I use R version 4.1.3 on macOS Monterey (v. 12.3.1) with an Apple M1 chip.
I would appreciate any suggestions!