Installing RStan on Mac Mohave


#1

Having incredible difficulty installing Rstan on MacOS Mojave.— Cannot figure out how to get C++ compiler installed on RStudio.
Tried to follow some of the trouble shooting earlier but have not had success.
Do I need to use R instead?


#2

No. But tell us what the error message is.


#3

So this is what I tried, and this is what happened….

install.packages(“rstan”, repos = “https://cloud.r-project.org/”, dependencies = TRUE)

trying URL ‘https://cloud.r-project.org/bin/macosx/el-capitan/contrib/3.5/rstan_2.18.2.tgz

Content type ‘application/x-gzip’ length 19107931 bytes (18.2 MB)


#4

Looks fine so far. Was there an error message?


#5

Oh, it didn’t paste all of it, hang on…
here are the first few screen shots:


!


#6

the last four:



#7

Perhaps try Stan with Mojave MacOS first? Then install.packages("rstan") again. There is more advice for Mojave here: Dealing with Mojave.


#8

Ah the main problem I see is I can’t find devtools

trying URL ‘https://cran.rstudio.com/src/contrib/devtools_2.0.1.tar.gz

Content type ‘application/x-gzip’ length 388953 bytes (379 KB)


#9

What is the exact code to try there? I tried copying and pasting the command in that reply and just get error messages.


#10

I also have trouble it seems with rlang.


#11

If I remember correctly I had same problem and my issues were solved by installing headers for Xcode

$ sudo installer -pkg /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg -target /