Compiler quitting

Having trouble with compiling a simple regression model. I tried #495 of the Stan_demo() models and here’s the message coming back
DIAGNOSTIC(S) FROM PARSER:
Info (non-fatal): assignment operator <- deprecated in the Stan language; use = instead.
Info (non-fatal): assignment operator <- deprecated in the Stan language; use = instead.
Info (non-fatal): assignment operator <- deprecated in the Stan language; use = instead.

Error in compileCode(f, code, language = language, verbose = verbose) :
Compilation ERROR, function(s)/method(s) not created! In file included from file8a7362b942d.cpp:8:
In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/StanHeaders/include/src/stan/model/model_header.hpp:4:
In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/StanHeaders/include/stan/math.hpp:4:
In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/StanHeaders/include/stan/math/rev/mat.hpp:4:
In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/StanHeaders/include/stan/math/rev/core.hpp:4:
In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/StanHeaders/include/stan/math/rev/core/autodiffstackstorage.hpp:4:
In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/StanHeaders/include/stan/math/memory/stack_alloc.hpp:8:
In file included from /usr/local/clang4/bin/…/include/c++/v1/cstdlib:86:
/
In addition: Warning message:
In system(cmd, intern = !verbose) :
running command ‘/Library/Frameworks/R.framework/Resources/bin/R CMD SHLIB file8a7362b942d.cpp 2> file8a7362b942d.cpp.err.txt’ had status 1
Error in sink(type = “output”) : invalid connection

Here’s the session info.
R version 3.5.3 (2019-03-11)
Platform: x86_64-apple-darwin15.6.0 (64-bit)
Running under: macOS Mojave 10.14.4

Matrix products: default
BLAS: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/3.5/Resources/lib/libRlapack.dylib

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
[1] stats graphics grDevices utils datasets methods base

other attached packages:
[1] rstan_2.18.2 StanHeaders_2.18.1 ggplot2_3.1.1

loaded via a namespace (and not attached):
[1] Rcpp_1.0.1 pillar_1.3.1 compiler_3.5.3 plyr_1.8.4
[5] prettyunits_1.0.2 tools_3.5.3 pkgbuild_1.0.3 tibble_2.1.1
[9] gtable_0.3.0 pkgconfig_2.0.2 rlang_0.3.3 cli_1.1.0
[13] rstudioapi_0.10 parallel_3.5.3 loo_2.1.0 gridExtra_2.3
[17] withr_2.1.2 dplyr_0.8.0.1 stats4_3.5.3 grid_3.5.3
[21] tidyselect_0.2.5 glue_1.3.1 inline_0.3.15 R6_2.4.0
[25] processx_3.3.0 callr_3.2.0 purrr_0.3.2 magrittr_1.5
[29] scales_1.0.0 ps_1.3.0 matrixStats_0.54.0 assertthat_0.2.1
[33] colorspace_1.4-1 lazyeval_0.2.2 munsell_0.5.0 crayon_1.3.4

Any help on this would be greatly appreciated.

thanks in advance.
Ted W. Simon

This appears to be a typical Mojave problem. The solution seems to differ from one person to the next though:

Thank you!