Error in open.connection(con, open = mode) : Timeout was reached: [github.com]

Sorry for not getting to this sooner. This is caused by RStan 2.21 checking whether your Stan model will compile using the next version of the Stan compiler. It does this by downloading a compiler binary from Github. But if your network disallows this, then it can fail with an error (this is what happens on my work network).

Two solutions here. Firstly, you can disable the check by running:

rstan_options(javascript=FALSE)

Alternatively, you can try the preview of the next Rstan version which already uses the new compiler and so doesn’t contact github:

remove.packages(c("StanHeaders", "rstan"))
install.packages("StanHeaders", repos = c("https://mc-stan.org/r-packages/", getOption("repos")))
install.packages("rstan", repos = c("https://mc-stan.org/r-packages/", getOption("repos")))

2 Likes