Rstudio server path isn't picking up linuxbrew dependencies?


I am running a local instance of Rstudio server on WSL2


I cannot use blogdown::build_site(). I get the following error message Error: failed to download modules: exec: "go": executable file not found in $PATH

I downloaded go via linux brew. So I suspect a path issue.


In the RStudio server R console, I ran system("echo $PATH") and I get the following:


However, when I am in the RStudio linux terminal, go into R, and then run system("echo $PATH"), I get a much different result:



How can I get the R console in RStudio server to pick the dependencies obtained via linuxbrew?


I figured out the solution: Sys.setenv(PATH = paste0("/home/linuxbrew/.linuxbrew/bin:/home/linuxbrew/.linuxbrew/sbin:", old_path)). Where old_path <- Sys.getenv("PATH")


I got inspiration from this link


If there is a better way, please let me know, but this works :slight_smile:

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.