我是一个闪亮服务器的初学者。我已经在我的电脑上安装了它,并且我可以让默认的应用程序在http://localhost:3838/sample-apps/rmd/上正常工作。
然而,我尝试了一些学习应用程序(我复制到/srv/shiny-server/sample- apps /rmd/目录中),但都失败了,并显示以下消息:“发生错误。请检查您的日志或联系应用程序作者以获得澄清”。
/var/ log /shiny-server上的日志文件显示(据我所知)没有安装learnr包,尽管它确实安装了,并且learnr应用程序在从RStudio启动时在我的计算机上运行良好。
--
Warning: Error in : package or namespace load failed for 'learnr':
.onAttach failed in attachNamespace() for 'learnr', details:
call: NULL
error: The shiny_prerendered_chunk function can only be called from within runtime: shiny_prerendered
139: stop
138: value[[3L]]
137: tryCatchOne
136: tryCatchList
135: tryCatch
134: library
133: eval
132: eval
127: evaluate_call
126: evaluate::evaluate
125: evaluate
123: block_exec
122: call_block
121: process_group.block
118: process_file
117: knitr::knit
116: <Anonymous>
111: <reactive>
95: doc
94: shiny::renderUI
93: func
80: origRenderFunc
79: output$__reactivedoc__
3: <Anonymous>
1: rmarkdown::run发布于 2020-06-25 03:12:58
我也有同样的问题。实际上,问题不在于您没有正确安装learnr;您的问题实际上是名称空间问题。可以通过在服务器机器上直接安装带有install.packages的tidyverse包(“tidyverse”)来解决这个问题。
谨致问候。
发布于 2020-10-01 19:21:43
我也有同样的错误信息。然而,我尝试在运行最新版本的R、RStudio服务器和ShinyServer的Ubuntu机器(18.04 x64)上部署exercise.Rmd。导致错误的部署文件夹是/opt/shiny-server/samples/sample-apps/的子文件夹da。这意味着,http://r.smartana.org/sample-apps/da/exercise.Rmd显示了一个错误。
我的解决方案是创建一个与文件夹名相同的文件夹,并添加相应的html文件。这意味着,我在sample-apps文件夹中添加了exercise/exercise.Rmd和exercise/exercise.html。现在可以通过http://r.smartana.org/sample-apps/exercise/和http://r.smartana.org/sample-apps/exercise/exercise.Rmd访问(但不能通过html扩展)。
学到的课程
文件部署文件名及其文件夹名必须为identical;
https://stackoverflow.com/questions/52017778
复制相似问题