rstudio / rstudio

RStudio is an integrated development environment (IDE) for R
https://posit.co/products/open-source/rstudio/
Other
4.71k stars 1.1k forks source link

RStudio Server uses different paths than RStudio Desktop for R package build #8939

Open yurivict opened 3 years ago

yurivict commented 3 years ago

System details

RStudio Edition : Server
RStudio Version : 1.3.1093
OS Version      : FreeBSD 12.2
R Version       : 4.0.3

Steps to reproduce the problem

install.packages("learnr") fails in RStudio Server because it doesn't use the same path that this user normally has:

* installing *source* package ‘fs’ ...
** package ‘fs’ successfully unpacked and MD5 sums checked
** using staged installation
** libs
sh: gmake: not found
Warning in system(cmd) : error in running command
ERROR: compilation failed for package ‘fs’
* removing ‘/usr/home/yuri/R/amd64-portbld-freebsd12.1-library/4.0/fs’
Warning in install.packages :
  installation of package ‘fs’ had non-zero exit status
* installing *source* package ‘Rcpp’ ...
** package ‘Rcpp’ successfully unpacked and MD5 sums checked
** using staged installation
** libs
sh: gmake: not found
Warning in system(cmd) : error in running command
ERROR: compilation failed for package ‘Rcpp’
* removing ‘/usr/home/yuri/R/amd64-portbld-freebsd12.1-library/4.0/Rcpp’

This command succeeds in pure R session, and in RStudio Desktop.

$ echo $PATH
/home/yuri/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin
$ which gmake
/usr/local/bin/gmake
$ which R
/usr/local/bin/R

It appears to run the R session in RStudio Server with a damaged PATH environment variable, because the "Terminal" tab shows correct PATH.

yurivict commented 3 years ago

Workaround: Sys.setenv(PATH = paste("/usr/local/bin:",Sys.getenv("PATH"), sep="")) -- this should be executed in the "Console" tab.

github-actions[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs, per https://github.com/rstudio/rstudio/wiki/Issue-Grooming. Thank you for your contributions.

yurivict commented 3 years ago

ping

github-actions[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs, per https://github.com/rstudio/rstudio/wiki/Issue-Grooming. Thank you for your contributions.

colearendt commented 2 years ago

pong