簡體   English   中英

我無法在Shinyapps.io上發布我的Shiny App

[英]I can't publish my Shiny App on shinyapps.io

我一直在嘗試在Shinyapps.io上部署Shiny App,但始終有相同的響應: ERROR: An error has occurred. Check your logs or contact the app author for clarification. ERROR: An error has occurred. Check your logs or contact the app author for clarification. 最初,我使用自己的應用程序嘗試了此操作,但我放棄了,盡管我的應用程序有錯誤。 然后我從互聯網上得到了一個非常簡單的應用程序,它只有幾行代碼,而且...很驚訝!,它沒有用。 我不知道為什么,因為我按照所有步驟操作,並且在本地窗口中看到了該應用程序。 所以我檢查了相對路徑,等等,沒有使用。 日志都無濟於事,所以我不知道該怎么辦。 請任何建議可能會有用。 非常感謝

這是R閃亮代碼:

用戶界面

library(shinydashboard)
library(rsconnect)


setwd(dirname(rstudioapi::getActiveDocumentContext()$path))
deployApp()
ui <- dashboardPage(
  dashboardHeader(title = "Info boxes"),
  dashboardSidebar(),
  dashboardBody(
    # infoBoxes with fill=FALSE
    fluidRow(
      # A static infoBox
      infoBox("New Orders", 10 * 2, icon = icon("credit-card")),
      # Dynamic infoBoxes
      infoBoxOutput("progressBox"),
      infoBoxOutput("approvalBox")
    ),

    # infoBoxes with fill=TRUE
    fluidRow(
      infoBox("New Orders", 10 * 2, icon = icon("credit-card"), fill = TRUE),
      infoBoxOutput("progressBox2"),
      infoBoxOutput("approvalBox2")
    ),

    fluidRow(
      # Clicking this will increment the progress amount
      box(width = 4, actionButton("count", "Increment progress"))
    )
  )
)

服務器

server <- function(input, output) {
  output$progressBox <- renderInfoBox({
    infoBox(
      "Progress", paste0(25 + input$count, "%"), icon = icon("list"),
      color = "purple"
    )
  })
  output$approvalBox <- renderInfoBox({
    infoBox(
      "Approval", "80%", icon = icon("thumbs-up", lib = "glyphicon"),
      color = "yellow"
    )
  })

  # Same as above, but with fill=TRUE
  output$progressBox2 <- renderInfoBox({
    infoBox(
      "Progress", paste0(25 + input$count, "%"), icon = icon("list"),
      color = "purple", fill = TRUE
    )
  })
  output$approvalBox2 <- renderInfoBox({
    infoBox(
      "Approval", "80%", icon = icon("thumbs-up", lib = "glyphicon"),
      color = "yellow", fill = TRUE
    )
  })
}

日志:

    2018-04-26T16:47:00.598156+00:00 shinyapps[331049]: 
2018-04-26T16:47:00.608370+00:00 shinyapps[331049]: The following object is masked from ‘package:shiny’:
2018-04-26T16:47:00.608017+00:00 shinyapps[331049]: 
2018-04-26T16:47:00.608371+00:00 shinyapps[331049]: 
2018-04-26T16:47:00.608019+00:00 shinyapps[331049]: Attaching package: ‘rsconnect’
2018-04-26T16:47:00.608371+00:00 shinyapps[331049]:     serverInfo
2018-04-26T16:47:00.598159+00:00 shinyapps[331049]: Attaching package: ‘shinydashboard’
2018-04-26T16:47:00.608372+00:00 shinyapps[331049]: 
2018-04-26T16:47:00.598161+00:00 shinyapps[331049]: 
2018-04-26T16:47:00.612987+00:00 shinyapps[331049]: Warning: Error in : RStudio not running
2018-04-26T16:47:00.617053+00:00 shinyapps[331049]:     12: fn
2018-04-26T16:47:00.598930+00:00 shinyapps[331049]: The following object is masked from ‘package:graphics’:
2018-04-26T16:47:00.617046+00:00 shinyapps[331049]: Stack trace (innermost first):
2018-04-26T16:47:00.617054+00:00 shinyapps[331049]:     11: doTryCatch
2018-04-26T16:47:00.598932+00:00 shinyapps[331049]: 
2018-04-26T16:47:00.617048+00:00 shinyapps[331049]:     58: verifyAvailable
2018-04-26T16:47:00.617054+00:00 shinyapps[331049]:     10: tryCatchOne
2018-04-26T16:47:00.598933+00:00 shinyapps[331049]:     box
2018-04-26T16:47:00.617048+00:00 shinyapps[331049]:     57: callFun
2018-04-26T16:47:00.617054+00:00 shinyapps[331049]:      9: tryCatchList
2018-04-26T16:47:00.617051+00:00 shinyapps[331049]:     55: rstudioapi::getActiveDocumentContext
2018-04-26T16:47:00.617055+00:00 shinyapps[331049]:      7: connect$retry
2018-04-26T16:47:00.617052+00:00 shinyapps[331049]:     54: dirname
2018-04-26T16:47:00.617056+00:00 shinyapps[331049]:      6: eval
2018-04-26T16:47:00.617052+00:00 shinyapps[331049]:     53: setwd
2018-04-26T16:47:00.617053+00:00 shinyapps[331049]:     13: runApp
2018-04-26T16:47:00.598934+00:00 shinyapps[331049]: 
2018-04-26T16:47:00.617049+00:00 shinyapps[331049]:     56: getDocumentContext
2018-04-26T16:47:00.617055+00:00 shinyapps[331049]:      8: tryCatch
2018-04-26T16:47:00.608019+00:00 shinyapps[331049]: 
2018-04-26T16:47:00.617057+00:00 shinyapps[331049]:      4: eval
2018-04-26T16:47:00.617057+00:00 shinyapps[331049]:      3: eval
2018-04-26T16:47:00.617057+00:00 shinyapps[331049]:      2: eval.parent
2018-04-26T16:47:00.617058+00:00 shinyapps[331049]:      1: local
2018-04-26T16:47:00.617405+00:00 shinyapps[331049]: Error : An error has occurred. Check your logs or contact the app author for clarification.
2018-04-26T16:47:00.617056+00:00 shinyapps[331049]:      5: eval

解決了。 我在這里發布了我該如何幫助遇到相同問題的人。 首先,我的主要問題是不了解Dockerfile的工作原理,因此在閱讀一些文檔后,我發現我沒有添加Shiny Server所需的軟件包。

此頁面: https : //www.linode.com/docs/development/r/how-to-deploy-rshiny-server-on-ubuntu-and-debian/對我有很大幫助。

另外,我建議使用命令“ sudo R”並首先嘗試每個R安裝軟件包,以查看每時每刻發生的情況(我在RStudio中制作了該應用程序,因此我不知道需要哪些軟件包,例如libssl-dev) 。 這樣,您可以輕松查看所有日志,並能夠知道您未包含哪些軟件包,並且必須將其包含在Dockerfile中

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM