应用启动时,RStudio服务器上的R Shiny开发人员Shiny崩溃 [英] R Shiny dev on RStudio server Shiny crashes when app launch

查看:65
本文介绍了应用启动时,RStudio服务器上的R Shiny开发人员Shiny崩溃的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对Shiny并不陌生,但对R并不陌生.由于工作原因,我现在正在RStudio服务器中进行R开发.如果有帮助,它可以在Google Compute Engine上运行.RStudio服务器运行正常,但是Shiny遇到了问题.

I'm new to Shiny, but not new to R. Because of work, I'm now doing R development in RStudio server. It is running on Google Compute Engine, if that makes a difference. RStudio server runs just fine, but Shiny is having problems.

安装Shiny之后,我运行了示例命令:

After installing shiny, I ran the example command:

runExample("01_hello")

runExample("01_hello")

首先,这带来了Hello Shiny!应用程序,但一切都是灰色的.我重新启动了RStudio,清理了工作区,然后再次运行了命令.现在弹出一个窗口,但它立即消失.我尝试重新启动RStudio服务器,并在其他浏览器中运行,但是行为仍在继续.

At first, this brought up the Hello Shiny! app, but everything was grey. I restarted RStudio, cleaned the workspace, and ran the command again. Now a window pops up, but it immediately disappears. I tried restarting RStudio server, and running in a different browser, but the behavior continues.

我尝试快速单击在浏览器中打开"按钮,这使我在浏览器中获得一个灰色选项卡,就像重新启动之前一样.

I've tried quickly clicking the "Open in Browser" button, and that gets me a tab in my browser that's grey, just like before I restarted.

有什么建议吗?谢谢.

当我启动示例时,RStudio控制台会提供:

When I launch the example, the RStudio console gives:

Listening on http://127.0.0.1:4096

坐在那里直到我按esc.

And just sits there until I press esc.

IE控制台没有任何错误(尽管我也不确定我是否使用正确-抱歉,不是网络专家).

The IE Console gives no errors (although I'm also not sure if I'm using it right--not a web guy, sorry).

Chrome控制台确实出现错误:

The Chrome console does give an error:

'webkitRequestAnimationFrame'是特定于供应商的.请使用而是标准的"requestAnimationFrame".

'webkitRequestAnimationFrame' is vendor-specific. Please use the standard 'requestAnimationFrame' instead.

其中有指向VM320:6635的链接,内容为:

Which has a link to VM320:6635 which reads:

function _b(b,c){var d = b; var e = Gni(function(){vara = wj(); d.Df(a)});返回$ wnd.webkitRequestAnimationFrame(e,c)}

function _b(b,c){var d=b;var e=Gni(function(){var a=wj();d.Df(a)});return $wnd.webkitRequestAnimationFrame(e,c)}

推荐答案

我主要是想出我的问题.启动Shiny应用程序后,该窗口仍会关闭,但是现在我可以导航至Shiny应用程序.这足以让我考虑此修复程序.

I've figured out my issue, mostly. The window still closes as soon as I launch the Shiny app, but now I can navigate to the Shiny app. This is good enough for me to consider this fixed.

我必须做两件事.首先,我必须使用GCE的命令行打开Shiny正在监听的端口,这是使用命令行的第二个答案:

There were two things I had to do. First, I had to open up the port that Shiny was listening on using GCE's command line, which was the second answer here, using the command line: How to open a specific port such as 9090 in Google Compute Engine

然后,我必须使用以下命令启动Shiny应用程序:

Then, I had to launch the Shiny app with the following command:

runExample("01_hello", host="0.0.0.0", port=9999)

这也可以与 runApp 命令一起使用.9999是您使用GCE打开的端口号,并且 host = 0.0.0.0 似乎告诉Shiny监听外部连接(来自in-R ?runApp 帮助文档).您实际上需要输入0.0.0.0,而不是机器的IP或类似的IP地址.

This works with the runApp command as well. 9999 is the port number you open with GCE, and host=0.0.0.0 seems to tell Shiny to listen for external connections (from the in-R ?runApp help documentation). You need to literally put 0.0.0.0 in, not the IP of your machine or anything like that.

即使在启动示例时窗口仍然关闭,我仍可以使用端口号导航到实例的外部IP并使用Shiny应用程序.

Even though the window closes still when I launch the example, I can how navigate to the external IP of the instance with the port number and use the Shiny app.

谢谢你们的帮助.如果您还想说更多话,请随时发表评论.

Thank you both for your assistance. Please feel free to comment if you think anything more should be said.

这篇关于应用启动时,RStudio服务器上的R Shiny开发人员Shiny崩溃的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆