I use gmailr
to retrieve emails from a gmail account. Due to my system configurations (nix home-manager on Debian), when gmailr
needs an interactive connection to gmail, nothing happens, it just waits forever.
Waiting for authentication in browser...
Press Esc/Ctrl + C to abort
It was working fine, until I remove the old brower form /usr/bin/
, and install it through nix to ~/.nix-profile/bin/
.
Is there a way to tell gmailr
or gargle
maybe, which browser to use for the authentication procedure?
I wasn't able to find something in docs or google.
Edit:
I now found, that the problem relies on the way gmailr
starts the browser from the system environment, I get this error:
Waiting for authentication in browser...
Press Esc/Ctrl + C to abort
/usr/bin/env: ‘.nix-profile/bin/brave’: No such file or directory
So I need to find a way to override the environment path....
I realize that there is an option in R for selecting the default browser!
So I just put
options(browser = "x-www-browser")
in mygmailr
script or in my.Rprofile
. Where "x-www-browser" is a system alias for my selected browser, but it can be any system path.