Problems installing shiny

December 21, 2015 2.8k views
Applications Miscellaneous

Hello, I am trying to install shiny and having issues with its dependencies. My server is an Ubuntu 14.04 using nginx as the web server. When I run the statement sudo su - -c "R -e \"install.packages('shiny', repos='http://cran.rstudio.com/')\"" at the command line, it starts to work. Here is the info that is returned when attempting to install.

  • installing source package ‘Rcpp’ ... ** package ‘Rcpp’ successfully unpacked and MD5 sums checked ** libs g++ -I/usr/share/R/include -DNDEBUG -I../inst/include/ -fpic -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -DFORTIFYSOURCE=2 -g -c Date.cpp -o Date.o g++ -I/usr/share/R/include -DNDEBUG -I../inst/include/ -fpic -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -DFORTIFYSOURCE=2 -g -c Module.cpp -o Module.o g++: internal compiler error: Killed (program cc1plus) Please submit a full bug report, with preprocessed source if appropriate. See <file:///usr/share/doc/gcc-4.8/README.Bugs> for instructions. make: *** [Module.o] Error 4 ERROR: compilation failed for package ‘Rcpp’
  • removing ‘/usr/local/lib/R/site-library/Rcpp’ ERROR: dependency ‘Rcpp’ is not available for package ‘httpuv’
  • removing ‘/usr/local/lib/R/site-library/httpuv’ ERROR: dependency ‘httpuv’ is not available for package ‘shiny’
  • removing ‘/usr/local/lib/R/site-library/shiny’

The downloaded source packages are in
‘/tmp/RtmpduxxBi/downloaded_packages’
Warning messages:
1: In install.packages("shiny", repos = "https://cran.rstudio.com/") :
installation of package ‘Rcpp’ had non-zero exit status
2: In install.packages("shiny", repos = "https://cran.rstudio.com/") :
installation of package ‘httpuv’ had non-zero exit status
3: In install.packages("shiny", repos = "https://cran.rstudio.com/") :
installation of package ‘shiny’ had non-zero exit status

So it appears two of the dependencies (Rcpp and httpuv), so far, while unpacking are not installing.

Does anyone know what may be causing this and even better, how to fix this issue? Thank you in advance for any solutions!

3 comments
  • It looks like you ran out of memory while compiling some of the C code for Rcpp. You should temporarily increase the size of your droplet. I have found that 1G is not enough memory to install all of my favorite R packages, but the 2G size will do. Alternatively, you can make a swap file. For that, follow the direction here; http://deanattali.com/2015/05/09/setup-rstudio-shiny-server-digital-ocean/

    I chose the latter option, and it worked fine.

    Regards,
    Homer

  • Thank you for your comment Homer! I have a swap file set up to handle the memory issue, so I am still at a bit of a loss on this one. The server seems to work, because I can visit the site the server sets up, but because shiny is not installed, it shows an error. I was able to install rmarkdown okay. It really has me scratching my head!

  • Hello Homer! I tried what you suggested concerning the swap file. I had a swap file set up already, but I only had it set to 1G. I increased it and that seems to have fixed the issue! That's the good news. The bad news is I got so frustrated, I destroyed the droplet and started over ... Uggggghhh. So, while I was able to get shiny installed just fine, my new problem is getting shiny-server to work again! LOL I just have to laugh as a bit of a defense mechanism. Thanks for your help though, you really came through!

1 Answer

This question was answered by @homerhanumat:

It looks like you ran out of memory while compiling some of the C code for Rcpp. You should temporarily increase the size of your droplet. I have found that 1G is not enough memory to install all of my favorite R packages, but the 2G size will do. Alternatively, you can make a swap file. For that, follow the direction here; http://deanattali.com/2015/05/09/setup-rstudio-shiny-server-digital-ocean/

I chose the latter option, and it worked fine.

Regards,
Homer

View the original comment

Have another answer? Share your knowledge.