【问题标题】:Deploy shiny app on shinyapp.io with package in private organization repo在 shinyapp.io 上部署闪亮的应用程序,并在私人组织仓库中使用包
【发布时间】:2018-11-16 16:34:16
【问题描述】:

我正在尝试将闪亮的应用程序部署到 shinyapps.io 服务器,但不断收到与托管在我们组织拥有的私有 github 存储库中的定制包相关的错误(请注意,我已替换以下错误中的包的实际名称、公司名称和私有 repo 名称):

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

我知道 repo 链接很好,因为通过 devtools::install_github("ORGANIZATION/PRIVATE_REPO, auth_token = token 安装有效。 我是组织页面的管理员,并且还确保 token 具有 repo 和 admin:org 范围。

我还确保在我的 shinyapps.io 帐户页面中勾选“私人存储库访问”,如 here 所述。

有人对我可能做错了什么有任何想法吗?

谢谢!

【问题讨论】:

  • 您确定您已授权 shinyapps.io 使用您的 github 个人资料吗?请参阅帐户 > 个人资料 > 向下滚动以连接 github。

标签: github deployment repository rstudio shinyapps


【解决方案1】:

在您打算部署的项目文件夹中创建一个.Rprofile 文件。

您需要在.Rprofile 中设置该回购选项。并添加您的私人 github 链接。像

# 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)
})

这在这里得到了很好的解释。 Package management in RStudio Connect.

【讨论】:

    【解决方案2】:

    以防万一,我发现上述答案允许特定的公司存储库,而不是从私人 github 存储库安装。为此,this link 有话要说:

    转到 Account >> Profile,然后在 github 下链接帐户,并允许私有 repo 访问。

    【讨论】:

      【解决方案3】:

      必须在 shinyapps.io 仪表板中启用对 repo 的私有访问,如 here 所示

      但您还需要从 github -> 设置 -> 应用程序向组织授予适当的权限

      从应用列表中选择shinyapps

      然后授予特定组织的访问权限

      你就完成了! rsconnect 将自动检测 repo 的来源,前提是它使用 auth_token 参数安装,使用 devtools::install_github

      【讨论】:

        猜你喜欢
        • 2019-04-24
        • 2016-12-28
        • 2014-08-09
        • 2021-01-29
        • 1970-01-01
        • 2018-02-03
        • 2017-11-08
        • 2018-05-24
        • 1970-01-01
        相关资源
        最近更新 更多