2017-08-29 31 views
1

我試圖通過cron作業運行一些Rscript。 我正在使用RGA包。 我在終端得到的錯誤是:BASH中的錯誤:oauth_listener()需要一個交互式環境

Access token will be stored in the './ga-token.rds' file.
Error: oauth_listener() needs an interactive environment.

Execution halted

我的代碼是:

library(RGA) 

authorize(client.id = ".......", client.secret = ".......", cache = "./ga-token.rds") 

回答

0

您需要下載並安裝httpuv
install.packages( 「httpuv」)。
之後
要求(「httpuv」)。
它的工作:
rga_auth < - 授權(client.id = 「XXXXXXX.apps.googleusercontent.com」,client.secret = 「XXXXXXXXXX」) 訪問令牌將被存儲在」 .ga-token.rds'文件。 將.ga-token.rds添加到.gitignore 正在等待瀏覽器中的身份驗證... 按Esc/Ctrl + C放棄 身份驗證已完成。

相關問題