brms, rstan and other packages needing compilation in RStudio Cloud

This is the output of a small script I use for teaching when running on RSrudio Cloud. The same problem is solved on my Xubuntu 18.04 by allowing to write and execute files in the /tmp directory (sorry I forgot to mention that before, although it was clear from the shell command) . Thank you!

library(brms)
Loading required package: Rcpp
Loading required package: ggplot2
Loading 'brms' package (version 2.7.0). Useful instructions
can be found by typing help('brms'). A more detailed introduction
to the package is available through vignette('brms_overview').
Run theme_set(theme_default()) to use the default bayesplot theme.
dat <- read.csv("SocInfExperiment.csv")
dat$status <- relevel(dat$status, ref="low")
summary(dat)
    distance     social.influence  status   
 Min.   :1.970   no :148          low :191  
 1st Qu.:2.690   yes:153          high:110  
 Median :3.090                              
 Mean   :3.135                              
 3rd Qu.:3.490                              
 Max.   :5.170                              
bm <- brm(distance ~ social.influence * status, dat)
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 /home/rstudio-user/R/x86_64-pc-linux-gnu-library/3.5/BH/include/boost/smart_ptr/shared_ptr.hpp:28:0,
                 from /home/rstudio-user/R/x86_64-pc-linux-gnu-library/3.5/BH/include/boost/shared_ptr.hpp:17,
                 from /home/rstudio-user/R/x86_64-pc-linux-gnu-library/3.5/StanHeaders/include/stan/math/prim/mat/fun/LDLT_factor.hpp:7,
                 from /home/rstudio-user/R/x86_64-pc-linux-gnu-library/3.5/StanHeaders/include/stan/math/prim/mat/err/check_ldlt_factor.hpp:6,
                 from /home/rstudio-user/R/x86_64-pc-linux-gnu-library/3.5/StanHeaders/include/stan/math/prim/mat.hpp:33,
                 from /home/rstudio-user/R/x86_64-pc-linux-gnu-library/3.5/StanHeaders/include/stan/math/rev/mat.hpp:12,
                 from /home/rstudio-user/R/x86_64-pc-linux-gnu-library/3.5/StanHeaders/include/stan/math.hpp:4,
                 from /home/rstudio-user/R/x86_64-pc-linux-gnu-libr
In addition: Warning message:
In system(cmd, intern = !verbose) :
 

 Error in compileCode(f, code, language = language, verbose = verbose) : 
  Compilation ERROR, function(s)/method(s) not created! In file included from /home/rstudio-user/R/x86_64-pc-linux-gnu-library/3.5/BH/include/boost/smart_ptr/shared_ptr.hpp:28:0,
                 from /home/rstudio-user/R/x86_64-pc-linux-gnu-library/3.5/BH/include/boost/shared_ptr.hpp:17,
                 from /home/rstudio-user/R/x86_64-pc-linux-gnu-library/3.5/StanHeaders/include/stan/math/prim/mat/fun/LDLT_factor.hpp:7,
                 from /home/rstudio-user/R/x86_64-pc-linux-gnu-library/3.5/StanHeaders/include/stan/math/prim/mat/err/check_ldlt_factor.hpp:6,
                 from /home/rstudio-user/R/x86_64-pc-linux-gnu-library/3.5/StanHeaders/include/stan/math/prim/mat.hpp:33,
                 from /home/rstudio-user/R/x86_64-pc-linux-gnu-library/3.5/StanHeaders/include/stan/math/rev/mat.hpp:12,
                 from /home/rstudio-user/R/x86_64-pc-linux-gnu-library/3.5/StanHeaders/include/stan/math.hpp:4,
                 from /home/rstudio-user/R/x86_64-pc-linux-gnu-libr
 

 Error in sink(type = "output") : invalid connection