Problem running stan_model()
Summary:
When I run stan_model('my_file.stan') I get an error saying:
Error in sink(type = "output") : invalid connection
Description:
The full error is:
running command '/Library/Frameworks/R.framework/Resources/bin/R CMD SHLIB file7fdb2efd6cb3.cpp 2> file7fdb2efd6cb3.cpp.err.txt' had status
1Error in compileCode(f, code, language = language, verbose = verbose) :
Compilation ERROR, function(s)/method(s) not created! clang: warning: no such sysroot directory: '/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk' [-Wmissing-sysroot]
In file included from <built-in>:1:
In file included from /Library/Frameworks/R.framework/Versions/3.6/Resources/library/StanHeaders/include/stan/math/prim/mat/fun/Eigen.hpp:13:
In file included from /Library/Frameworks/R.framework/Versions/3.6/Resources/library/RcppEigen/include/Eigen/Dense:1:
In file included from /Library/Frameworks/R.framework/Versions/3.6/Resources/library/RcppEigen/include/Eigen/Core:82:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/new:90:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/exception:81:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cs
Error in sink(type = "output") : invalid connection
I am using: RStan: "2.19.1" macOS: Catalina R Version: "3.6.3" RStudio Version: "1.2.5033"
I wonder how to resolve this?
I get the same error when trying to run a brms model in Stan:
Compiling the C++ model
Error in compileCode(f, code, language = language, verbose = verbose) :
Compilation ERROR, function(s)/method(s) not created! In file included from
Also in macOS Catalina, R version 3.5.3
Sorry nobody responded to this! I just noticed when going through old issues. I'm going to close this since I think all these issues are resolved by the latest releases of R and RStan, but if these issues persist let us know and we'll reopen this and help out!