R - Safari 浏览器上的 Shinyapps.io 无法连接到服务器"localhost "



我在shiny中创建了一个基本的应用程序,可以连接数据并将其上传到共享的googlesheet。该应用程序在本地运行良好,但是当我尝试在网络浏览器中运行它时,它不会上传任何数据。

问题似乎很简单。使用闪亮 apps.io 我可以查看应用程序日志,它确定我需要提供应用程序权限(特别是闪亮应用程序和整洁)将数据上传到谷歌表格,这是由谷歌表格授权的。这没问题,因为我在本地自己的机器上经历了相同的过程:

1) I'm running on a Mac, OSX Mojave v 10.14.2 
2) I've enabled web sharing via the terminal with sudo apachectl start (I think that's all it took?)
3) I've scoured similar problems on here. 
4) The app opens and uploads data when I "view in browser" from the RStudio IDE
5) I wanted to try Shiny Server, however apparently they haven't written anything for Macs yet that doesn't have to built from source, which is way beyond my level.
6) The google sheet is published to the web as well.

这是从 shinyapps.io 日志中提供的消息

Listening on http://127.0.0.1:37073
2019-01-15T14:33:32.976569+00:00 shinyapps[636194]: Adding .httr-oauth to .gitignore
2019-01-15T14:33:33.012405+00:00 shinyapps[636194]: Please point your browser to the following url: 
2019-01-15T14:33:33.010168+00:00 shinyapps[636194]: Waiting for authentication in browser...
2019-01-15T14:33:33.010485+00:00 shinyapps[636194]: Press Esc/Ctrl + C to abort
2019-01-15T14:33:33.012759+00:00 shinyapps[636194]: "This is the provided URL"
I then go to the provided URL, that takes me to a accounts.google page that asks me to provide authentication to a specific google account, which I do.

然后我从野生动物园收到此错误:

Safari can't open the page "the provided URL" because safari cannot connect to the server "localhost"

我基本上希望这个应用程序只能由允许的谷歌帐户使用,这是一个共享的帐户,并且能够从最多 3 台不同的窗口机器上传,任何帮助表示赞赏!

自从我利用 R 中的 google sheets 包以来,我在我的代码中找到了一个临时解决方法,它作为一个函数调用:

gs_title("worksheet title") 

这允许应用程序识别已获得应用程序访问权限的工作表,但是这是在线上传应用程序时的问题,我使用了一个名为的不同函数:

gs_url("worksheet URL as copied from search bar")

它传递工作表的 url 显然绕过了本地服务器问题,并允许我从其他计算机打开应用程序。

最新更新