Can't deploy my app, Error in install.packages() 'lib = "/usr/lib/R/library"' is not writable

1,047 views
Skip to first unread message

Nikolay Braykov

unread,
Mar 3, 2015, 3:03:00 PM3/3/15
to shinyap...@googlegroups.com
> shinyapps::deployApp('/Users/nbraykov/Google Drive/SYNC w HOME/Grad Skool/Pronaca rotation/pronaca/data/R files/Shiny EDA to load/',appName="ShinyPronacaEDA")
The following potential problems were identified in the project files:

---------------
my.ggparallel.R
---------------
The following lines contain absolute paths:
173:   label.stats$labels <- gsub(sprintf("(%s):(.*)", varnames), "\\2", as.character(label.stats$Nodeset))

--------
server.R
--------
The following lines contain absolute paths:
6: install.packages(c('lme4','car','MASS', 'scales', 'mixtools','arm','plyr', 'ggparallel','RColorBrewer', 'vegan','grid','gridExtra', 'sjPlot', 'MuMIn'),repos="http://cran.rstudio.com" ,lib="/usr/lib/R/library")

Paths should be to files within the project directory.
Do you want to proceed with deployment? [Y/n]: Y
Preparing to deploy application...
Update application currently deployed at
DONE
Uploading application bundle...DONE
Deploying application: 33692...
Waiting for task: 14522919
  building: Parsing manifest
  building: Installing packages
  building: Installing files
  building: Pushing image: 138181
  deploying: Starting instances
  rollforward: Activating new instances
  terminating: Stopping old instances
Application successfully deployed to http://nbrayko.shinyapps.io/ShinyPronacaEDA

> shinyapps::showLogs()
2015-03-03T19:47:10.241624+00:00 shinyapps[33692]: R version: 3.1.0
2015-03-03T19:47:10.242933+00:00 shinyapps[33692]: rmarkdown version: 0.0.0
2015-03-03T19:47:10.241692+00:00 shinyapps[33692]: Shiny version: 0.10.2.1
2015-03-03T19:47:10.243431+00:00 shinyapps[33692]: knitr version: 0.0.0
2015-03-03T19:47:10.540198+00:00 shinyapps[33692]: 
2015-03-03T19:47:10.540203+00:00 shinyapps[33692]: Starting Shiny with process ID: '12'
2015-03-03T19:47:10.547275+00:00 shinyapps[33692]: 
2015-03-03T19:47:10.547277+00:00 shinyapps[33692]: Listening on http://0.0.0.0:55076
2015-03-03T19:47:18.418733+00:00 shinyapps[33692]: R version: 3.1.0
2015-03-03T19:47:18.419937+00:00 shinyapps[33692]: rmarkdown version: 0.0.0
2015-03-03T19:47:18.418781+00:00 shinyapps[33692]: Shiny version: 0.10.2.1
2015-03-03T19:47:18.420357+00:00 shinyapps[33692]: knitr version: 0.0.0
2015-03-03T19:47:18.706515+00:00 shinyapps[33692]: 
2015-03-03T19:47:18.706517+00:00 shinyapps[33692]: Starting Shiny with process ID: '25'
2015-03-03T19:47:18.712620+00:00 shinyapps[33692]: 
2015-03-03T19:47:18.712622+00:00 shinyapps[33692]: Listening on http://0.0.0.0:36125
2015-03-03T19:47:21.262792+00:00 shinyapps[33692]: [1] "/usr/local/lib/R/site-library" "/usr/lib/R/site-library"      
2015-03-03T19:47:21.262796+00:00 shinyapps[33692]: [3] "/usr/lib/R/library"           
2015-03-03T19:47:21.264819+00:00 shinyapps[33692]: Warning in install.packages(c("lme4", "car", "MASS", "scales", "mixtools",  :
2015-03-03T19:47:21.264821+00:00 shinyapps[33692]:   'lib = "/usr/lib/R/library"' is not writable
2015-03-03T19:47:21.265246+00:00 shinyapps[33692]: Error in install.packages(c("lme4", "car", "MASS", "scales", "mixtools",  : 
2015-03-03T19:47:21.265248+00:00 shinyapps[33692]:   unable to install packages

Why is the shiny server not installing my packages? 

Andy Kipp

unread,
Mar 3, 2015, 3:25:20 PM3/3/15
to Nikolay Braykov, shinyap...@googlegroups.com
Hi,

Shinyapps.io detects and installs packages for you automatically when you call deployApp(). You do not need, nor should have any calls to install.packages() anywhere in your source code.

-Andy

--
You received this message because you are subscribed to the Google Groups "ShinyApps Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to shinyapps-use...@googlegroups.com.
To post to this group, send email to shinyap...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/shinyapps-users/c818523e-4803-4556-9c95-eb59d5efab3d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Nikolay Braykov

unread,
Mar 3, 2015, 3:32:11 PM3/3/15
to shinyap...@googlegroups.com, nbra...@gmail.com
thank you Andy, I think i figured out what's wrong. 

I put the install.packages only after using the code below failed, so I thought I needed to tell the server to install. Turns out the lapply + required trick is what was failing me. I need to call each package one by one with "library" in order for shinyapps to fetch them. 

 libs <- c('lme4','car','MASS', 'scales', 'mixtools','arm','plyr', 'ggparallel','RColorBrewer', 'vegan','grid','gridExtra', 'sjPlot', 'MuMIn')
 lapply
(libs, require, character.only = T)

Andy Kipp

unread,
Mar 3, 2015, 3:36:39 PM3/3/15
to Nikolay Braykov, shinyap...@googlegroups.com
You are correct. The shinyapps.io dependency detector works by looking for library() and require() as well as double/triple colon function calls. Unfortunately it is not sophisticated enough to understand lapply.

Cheers
-Andy

Felipe Andres Concha Sepúlveda

unread,
May 28, 2018, 4:33:45 PM5/28/18
to shinyapps.io Users
Thanks good i fix it!!

Felipe Andres Concha Sepúlveda

unread,
May 28, 2018, 4:34:48 PM5/28/18
to shinyapps.io Users
Thanks Andy!!!
Reply all
Reply to author
Forward
0 new messages