rstudio / rsconnect

Publish Shiny Applications, RMarkdown Documents, Jupyter Notebooks, Plumber APIs, and more
http://rstudio.github.io/rsconnect/
134 stars 82 forks source link

Cannot deploy with packages installed from git #206

Closed bearloga closed 7 years ago

bearloga commented 7 years ago

I noticed this issue when trying to deploy an app that uses packages hosted on our Gerrit servers. When I installed the same package from the GitHub mirror, the app deployed fine. Have not checked whether this is the case for packages installed from bitbucket, SVN, and Bioconductor because I can't think of any packages to check. Here's a reproducible example of a simple leaflet shiny app:

app.R:

# devtools::install_git("https://github.com/rstudio/leaflet.git", force = TRUE) ~ doesn't work
# devtools::install_github("rstudio/leaflet", force = TRUE) ~ works

ui <- shiny::fluidPage(
   leaflet::leafletOutput("mymap")
)

server <- function(input, output) {
  output$mymap <- leaflet::renderLeaflet({
    leaflet::addTiles(leaflet::leaflet())
  })
}

shiny::shinyApp(ui = ui, server = server)

Output with leaflet installed via devtools::install_git():

Preparing to deploy application...DONE
Uploading bundle for application: 216225...DONE
Deploying bundle: 986526 for application: 216225 ...
Waiting for task: 488757013
  building: Parsing manifest
  building: Building image: 984275
  building: Fetching packages
  error: Building package: leaflet
################################ Begin Task Log ################################ 
################################# End Task Log ################################# 
Error: Unhandled Exception: Child Task 488757014 failed: Error building image: Error fetching leaflet (1.1.0.9000) source. <CRANPackageSource repo='http://cran.rstudio.org'> unable to satisfy package: leaflet (1.1.0.9000)
In addition: Warning message:
In FUN(X[[i]], ...) :
  Failed to infer source for package 'leaflet'; using latest available version on CRAN instead
Execution halted

Output with leaflet installed via devtools::install_github():

Preparing to deploy application...DONE
Uploading bundle for application: 216225...DONE
Deploying bundle: 986533 for application: 216225 ...
Waiting for task: 488757428
  building: Building image: 984282
  building: Installing packages
  building: Installing files
  building: Pushing image: 984282
  deploying: Starting instances
  terminating: Stopping old instances
Application successfully deployed to https://bearloga.shinyapps.io/reprex/
Deployment completed: https://bearloga.shinyapps.io/reprex/

P.S. Using rsconnect 0.8.5

jspiewak commented 7 years ago

CRAN, BioConductor and GitHub are the supported package repositories on shinyapps.io.

bearloga commented 7 years ago

Ah, thanks. I see it's a packrat issue, not a rsconnect issue. Okie dokie!

JiajinChen commented 6 years ago

Could you tell me how to solve this problem?

bearloga commented 6 years ago

@JiajinChen you can't :\ either get the package you want to use onto CRAN, BioConductor, or GitHub, or stop using the package in the app if you're deploying to shinyapps.io

JiajinChen commented 6 years ago

Thanks for your reply. You mean there aren't any solution to my problem? But the packages from Github and bioconductor is really necessary to my app.

发自网易邮箱大师 On 05/21/2018 01:13, Mikhail Popov wrote:

@JiajinChen you can't :\ either get the package you want to use onto CRAN, BioConductor, or GitHub, or stop using the package in the app if you're deploying to shinyapps.io

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

cderv commented 6 years ago

But the packages from Github and bioconductor is really necessary to my app.

If your app depends on CRAN, Github and Biocondoctor 📦 it is ok. See the shinyapps.io documentation http://docs.rstudio.com/shinyapps.io/getting-started.html#using-your-r-packages-in-the-cloud