Sophia Wilson
Sophia Wilson

Reputation: 477

Not able to authorize Google Sheet from Rstudio Server

I am not able to able to authorize Google Sheet using Rstudio Server. I have tried all the possible ways available on google but it didn't work.

I'm using below code.

library(googlesheets4)

gs4_auth()
# options(httr_oob_default=TRUE)
#gs4_deauth()
write_sheet(MyDF, "10XhCF-MmXw8gfIn4P0xg45MlIjna4YSfeq2I00gNhrt", sheet = 'Sheet1')

I have tried the same code in offline R by installing R on local machine it is working completely fine, but it doesn't work on R server.

I have tried all different browsers, but getting the below-mentioned error

enter image description here

Upvotes: 3

Views: 547

Answers (1)

Sinh Nguyen
Sinh Nguyen

Reputation: 4487

I suspect that this is because you are loading both googlesheets and googlesheets4 in one session. Please try following steps:

  • Start a new environment on the server
  • Load only googlesheets4 then call gs4_auth() again.

If the error persist. Please tryto clean up the ~/.cache/gargle folder which store the last authorization process and try again.

Update

Please try clear up the cache and follow the step Here is what happen on my server:

enter image description here

Upvotes: 1

Related Questions