Shiny App在本地运行,在全局部署时与​​服务器断开连接

时间:2016-08-01 16:33:14

标签: r shiny

我有一个Shiny应用程序,当我在自己的计算机上运行时工作正常,但无法通过shinyapps正确部署。每次我部署应用程序时,它都会变为灰色并显示“与服务器断开连接”。这是showLogs()的输出,但我对如何解释它有点困惑。我不知道为什么安装一些软件包时遇到问题。感谢任何帮助,谢谢!

2016-07-29T21:02:49.317725+00:00 shinyapps[115742]:      9: tryCatchList
2016-07-29T21:02:49.317725+00:00 shinyapps[115742]:      8: tryCatch
2016-07-29T21:02:49.317726+00:00 shinyapps[115742]:      7: connect$retry
2016-07-29T21:02:49.317726+00:00 shinyapps[115742]:      6: eval
2016-07-29T21:02:49.317729+00:00 shinyapps[115742]:      3: eval
2016-07-29T21:02:49.317729+00:00 shinyapps[115742]:      2: eval.parent
2016-07-29T21:02:49.317729+00:00 shinyapps[115742]:      1: local
2016-07-29T21:02:49.317912+00:00 shinyapps[115742]: Error in install.packages(pkgs = x, repos = "http://cran.r-project.org") : 
2016-07-29T21:02:49.317914+00:00 shinyapps[115742]:   unable to install packages
2016-07-29T21:02:49.317727+00:00 shinyapps[115742]:      5: eval
2016-07-29T21:02:49.317727+00:00 shinyapps[115742]:      4: eval
2016-08-01T14:50:49.315087+00:00 shinyapps[115742]: Server version: 0.4.5.2170
2016-08-01T14:50:49.470258+00:00 shinyapps[115742]: Starting R with process ID: '17'
2016-08-01T14:50:49.315120+00:00 shinyapps[115742]: R version: 3.3.0
2016-08-01T14:50:49.486190+00:00 shinyapps[115742]: 
2016-08-01T14:50:49.315122+00:00 shinyapps[115742]: shiny version: 0.13.2
2016-08-01T14:50:49.486192+00:00 shinyapps[115742]: Listening on http://0.0.0.0:38250
2016-08-01T14:50:49.315126+00:00 shinyapps[115742]: rmarkdown version: NA
2016-08-01T14:50:49.315138+00:00 shinyapps[115742]: knitr version: NA
2016-08-01T14:50:49.315173+00:00 shinyapps[115742]: jsonlite version: 1.0
2016-08-01T14:50:49.315206+00:00 shinyapps[115742]: RJSONIO version: NA
2016-08-01T14:50:49.315226+00:00 shinyapps[115742]: htmltools version: 0.3.5
2016-08-01T14:50:49.464757+00:00 shinyapps[115742]: Using jsonlite for JSON processing
2016-08-01T14:50:49.470256+00:00 shinyapps[115742]: 
2016-08-01T14:50:52.097553+00:00 shinyapps[115742]: Loading required package: twitteR
2016-08-01T14:50:52.107937+00:00 shinyapps[115742]:     50: PrepareTwitter [/srv/connect/apps/Other-app/server.R#14]
2016-08-01T14:50:52.108128+00:00 shinyapps[115742]:   unable to install packages
2016-08-01T14:50:52.098304+00:00 shinyapps[115742]: Warning in library(package, lib.loc = lib.loc, character.only = TRUE, logical.return = TRUE,  :
2016-08-01T14:50:52.107937+00:00 shinyapps[115742]:     51: EnsurePackage [/srv/connect/apps/Other-app/server.R#6]
2016-08-01T14:50:52.107942+00:00 shinyapps[115742]:      4: eval
2016-08-01T14:50:52.098305+00:00 shinyapps[115742]:   there is no package called ‘twitteR’
2016-08-01T14:50:52.107936+00:00 shinyapps[115742]:     52: install.packages
2016-08-01T14:50:52.107942+00:00 shinyapps[115742]:      3: eval
2016-08-01T14:50:52.100256+00:00 shinyapps[115742]: Installing package into ‘/usr/local/lib/R/site-library’
2016-08-01T14:50:52.107940+00:00 shinyapps[115742]:      7: connect$retry
2016-08-01T14:50:52.107942+00:00 shinyapps[115742]:      2: eval.parent
2016-08-01T14:50:52.100257+00:00 shinyapps[115742]: (as ‘lib’ is unspecified)
2016-08-01T14:50:52.107935+00:00 shinyapps[115742]: Stack trace (innermost first):
2016-08-01T14:50:52.107941+00:00 shinyapps[115742]:      5: eval
2016-08-01T14:50:52.100629+00:00 shinyapps[115742]: Warning in install.packages(pkgs = x, repos = "http://cran.r-project.org") :
2016-08-01T14:50:52.107938+00:00 shinyapps[115742]:     13: runApp
2016-08-01T14:50:52.107939+00:00 shinyapps[115742]:     11: doTryCatch
2016-08-01T14:50:52.107943+00:00 shinyapps[115742]:      1: local
2016-08-01T14:50:52.100630+00:00 shinyapps[115742]:   'lib = "/usr/local/lib/R/site-library"' is not writable
2016-08-01T14:50:52.107938+00:00 shinyapps[115742]:     12: fn
2016-08-01T14:50:52.107939+00:00 shinyapps[115742]:     10: tryCatchOne
2016-08-01T14:50:52.108126+00:00 shinyapps[115742]: Error in install.packages(pkgs = x, repos = "http://cran.r-project.org") : 
2016-08-01T14:50:52.101513+00:00 shinyapps[115742]: Warning: Error in install.packages: unable to install packages
2016-08-01T14:50:52.107941+00:00 shinyapps[115742]:      6: eval
2016-08-01T14:50:52.107939+00:00 shinyapps[115742]:      9: tryCatchList
2016-08-01T14:50:52.107940+00:00 shinyapps[115742]:      8: tryCatch}

1 个答案:

答案 0 :(得分:0)

启动R会话并使用install.packages()从您的应用程序安装任何所需的包。然后,停止/统计你闪亮的服务器。

希望它有所帮助。