闪亮服务器上的错误错误:'restoreInput'不是'namespace:sh​​iny'中的导出对象

时间:2018-03-01 15:47:38

标签: r shiny shiny-server shinydashboard

我正在尝试运行一个闪亮的应用程序,当我在本地运行它时效果非常好但不是当我尝试在闪亮的Web服务器上运行它时。当我尝试通过浏览器访问它时,我得到的是以下错误消息:

ERROR: 'restoreInput' is not an exported object from 'namespace:shiny'

我知道有关此错误消息的问题之前曾在此处提出过:Shinydashboard: 'restoreInput' is not an exported object from 'namespace:shiny'但我相信该人正在本地运行该应用,所以我的问题与他们的问题截然不同。尽管如此,我显然已经尝试实现为该答案提供的所有解决方案,这些解决方案基本上只是“确保您拥有最新版本的R和最新版本的所需软件包”。我已经完成了这个,当我进入闪亮的服务器并获取我的ui和服务器脚本,然后调用sessionInfo()这是输出:

> sessionInfo()
R version 3.4.3 (2017-11-30)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 16.04.3 LTS

Matrix products: default
BLAS: /usr/lib/libblas/libblas.so.3.6.0
LAPACK: /usr/lib/lapack/liblapack.so.3.6.0

locale:
 [1] LC_CTYPE=en_GB.UTF-8       LC_NUMERIC=C
 [3] LC_TIME=en_GB.UTF-8        LC_COLLATE=en_GB.UTF-8
 [5] LC_MONETARY=en_GB.UTF-8    LC_MESSAGES=en_GB.UTF-8
 [7] LC_PAPER=en_GB.UTF-8       LC_NAME=C
 [9] LC_ADDRESS=C               LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_GB.UTF-8 LC_IDENTIFICATION=C

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base

other attached packages:
[1] shinydashboard_0.6.1 shinythemes_1.1.1    ggplot2_2.2.1
[4] raster_2.6-7         sp_1.2-7             leaflet_1.1.0
[7] shiny_1.0.5

loaded via a namespace (and not attached):
 [1] Rcpp_0.12.15     magrittr_1.5     munsell_0.4.3    colorspace_1.3-2
 [5] xtable_1.8-2     lattice_0.20-35  R6_2.2.2         rlang_0.2.0
 [9] plyr_1.8.4       grid_3.4.3       gtable_0.2.0     htmltools_0.3.6
[13] crosstalk_1.0.0  yaml_2.1.17      lazyeval_0.2.1   digest_0.6.15
[17] tibble_1.4.2     htmlwidgets_1.0  mime_0.5         compiler_3.4.3
[21] pillar_1.2.1     scales_0.5.0     httpuv_1.3.6.1

这几乎与我在本地版本的R中调用sessionInfo()时得到的输出完全相同,其中应用程序无缝运行。见下文:

> sessionInfo()
R version 3.4.3 (2017-11-30)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows >= 8 x64 (build 9200)

Matrix products: default

locale:
[1] LC_COLLATE=English_United Kingdom.1252  LC_CTYPE=English_United Kingdom.1252   
[3] LC_MONETARY=English_United Kingdom.1252 LC_NUMERIC=C                           
[5] LC_TIME=English_United Kingdom.1252    

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] shinydashboard_0.6.1 shinythemes_1.1.1    ggplot2_2.2.1        raster_2.6-7        
[5] sp_1.2-6             leaflet_1.1.0        shiny_1.0.5         

loaded via a namespace (and not attached):
 [1] Rcpp_0.12.14     magrittr_1.5     munsell_0.4.3    colorspace_1.3-2 xtable_1.8-2    
 [6] lattice_0.20-35  R6_2.2.2         rlang_0.1.2      plyr_1.8.4       tools_3.4.3     
[11] rgdal_1.2-16     grid_3.4.3       gtable_0.2.0     rgeos_0.3-26     htmltools_0.3.6 
[16] crosstalk_1.0.0  yaml_2.1.14      lazyeval_0.2.1   digest_0.6.14    tibble_1.3.4    
[21] htmlwidgets_0.9  rsconnect_0.8.5  mime_0.5         compiler_3.4.3   scales_0.5.0    
[26] jsonlite_1.5     httpuv_1.3.5    

最奇怪的是,最初当我进入闪亮的服务器并获取ui.R文件时,我收到了同样的错误消息。更新R和所有软件包之后,这种情况不再发生,但当我尝试在浏览器中打开应用程序时,我仍然会遇到相同的错误。我在服务器和ui脚本的开头添加了以下行,以确保它使用正确版本的R和最新的软件包。

loc <- '/path/to/location/of/correct/r/packages'
.libPaths(c(loc, .libPaths()))

有人可以告诉我可能发生的事情或如何最好地排除故障吗?

0 个答案:

没有答案