我一直试图在Shinyapps.io上部署一个闪亮的应用程序,但总是得到相同的响应:ERROR: An error has occurred. Check your logs or contact the app author for clarification.。一开始,我试着用我自己的应用程序,但我放弃了,我认为我的应用程序有一个错误。然后我从互联网上得到了一个非常简单的应用程序,只有几行代码……令人惊讶!,它没有工作。我不知道为什么,因为我遵循了所有的步骤,并且我在本地窗口上看到了这个应用程序。因此,我检查了相对路径等,没有使用任何路径。日志都没有帮助,所以我不知道还能做什么。请任何建议都可能是有用的。非常感谢
这是R闪亮代码:
ui.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.R
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发布于 2018-05-07 19:12:54
解决了。我在这里发布了我如何做到这一点,以帮助任何有同样问题的人。首先,我的主要问题是没有很好地理解Dockerfile是如何工作的,所以在一些文档之后,我发现我没有添加Shiny Server所需的包。
这个页面:https://www.linode.com/docs/development/r/how-to-deploy-rshiny-server-on-ubuntu-and-debian/帮了我很多。
此外,我建议使用命令"sudo R“,并首先尝试每个R安装包,以查看每个时刻都发生了什么(我是用RStudio编写的应用程序,所以我不知道-like libssl-dev -需要哪些包)。通过这种方式,您可以轻松地查看所有日志,并能够知道哪些包没有包含在Dockerfile中,以及哪些包必须包含在Dockerfile中
https://stackoverflow.com/questions/50048114
复制相似问题