Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.1k views
in Technique[技术] by (71.8m points)

github - Deploy shiny app on shinyapp.io with package in private organization repo

I'm trying to deploy a shiny app to the shinyapps.io server, but keep getting an error relating to a custom-built package that is hosted in a private github repo owned by our organization (note that I have replaced the actual name of the package, company name, and private repo name in the error below):

error: Building package: [PACKAGE NAME]
################################ Begin Task Log 
################################ 
################################# End Task Log 
################################# 
Error: Unhandled Exception: Child Task 530176316 failed: Error building 
image: Error fetching [PACKAGE NAME] (1.0.2) source. Error accessing GitHub 
repository ORGANIZATION/PRIVATE_REPO. HTTP 404: Not Found

I know the repo link is good, because installing via devtools::install_github("ORGANIZATION/PRIVATE_REPO, auth_token = token works. I'm an admin for the organization page, and also made sure that token has both repo and admin:org scope.

I've also made sure to tick "Private Repository Access" in my shinyapps.io account page as stated here.

Anyone have any thoughts on what I might be doing wrong??

Thanks!

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Create an .Rprofile file in your project folder that you would intend to deploy.

You would need to set that repo options in the .Rprofile. and add your private github link. Something like

# A sample .Rprofile file with two different package repositories.
local({
  r <- getOption("repos")
  r["CRAN"] <- "https://cran.rstudio.com/"
  r["mycompany"] <- "http://rpackages.mycompany.com/"
  options(repos = r)
})

This is well explained here. Package management in RStudio Connect.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...