Shiny App Deployment Errors

1,626 views
Skip to first unread message

Rich Pauloo

unread,
Sep 13, 2017, 6:26:01 PM9/13/17
to shinyapps.io Users
Hi There,

I'm attempting to deploy an app to shinyapps.io, and I get the following error:

Downloading GitHub repo nstrayer/shinyswipr@master from URL https://api.github.com/repos/nstrayer/shinyswipr/zipball/master Installing shinyswipr '/usr/lib/R/bin/R' --no-site-file --no-environ --no-save --no-restore --quiet \ CMD INSTALL \ '/tmp/RtmpJkuiih/devtools351afc0b59/nstrayer-shinyswipr-4584b11' \ --library='/usr/local/lib/R/site-library' --install-tests Error: ERROR: no permission to install to directory ‘/usr/local/lib/R/site-library’ Installation failed: Command failed (1) Attaching package: ‘dplyr’ The following objects are masked from ‘package:data.table’: between, first, last The following objects are masked from ‘package:stats’: filter, lag The following objects are masked from ‘package:base’: intersect, setdiff, setequal, union Attaching package: ‘DT’ The following objects are masked from ‘package:shiny’: dataTableOutput, renderDataTable Error in value[[3L]](cond) : cannot change working directory Calls: local ... tryCatch -> tryCatchList -> tryCatchOne -> <Anonymous> Execution halted



I think it may have something to do with the fact that my app.R code relies on a package from  a github source, and that in my app relies on a csv file that I initially load into my R environment. If I comment out devtools::install_github(), and setwd(), I still get the same error. This is what that code looks like, the rest is my ui(), server(), and shinyApp().


# load packages
devtools::install_github("nstrayer/shinyswipr")
library(shinyswipr)
library(shiny)
library(data.table)
library(dplyr)
library(DT)

# set wd
setwd('/Users/richpauloo/Desktop/AGU API')

# bring in cleaned 2016 data
dat <- fread("dat_2016.csv")


Joshua Spiewak

unread,
Sep 14, 2017, 3:20:30 PM9/14/17
to shinyapps.io Users
Your Shiny application cannot contain install commands. It should only contain library references.

Remove the devtools::install_github("nstrayer/shinyswipr"), but leave the library(shinyswipr)

You are also correct, you cannot call setwd with an absolute path. The filesystem on shinyapps.io is not the same as your local computer. All files should be contained in the project directory and can be referenced with relative paths.

Once you have made those changes, if you are still having issues, please send new error output.
Reply all
Reply to author
Forward
0 new messages