所以我在(unix发行版)Gentoo Machine上安装了RStudio Server。它似乎工作正常,我可以从远程计算机访问网页。 问题是机器上有两个版本的R,3.0.1和3.2.3。
Rstudio服务器默认使用位于/ usr / bin / R中的3.0.1版本。 虽然我希望使用位于/ usr / local / bin / R中的3.2.3版本。在this article on RStudio之后,我在服务器配置文件中设置了这些变量:
rsession-ld-library-path=/usr/local/lib/R
rsession-which-r=/usr/local/bin/R
回到Web界面的控制台,我执行了这个命令:
> R.version.string
[1] "R version 3.2.3 (2015-12-10)"
然而,当我执行
时> install.packages("devtools")
Installing package into ‘/home/xxxxx/R/x86_64-pc-linux-gnu-library/3.0’
(as ‘lib’ is unspecified)
also installing the dependencies ‘xml2’, ‘evaluate’, ‘roxygen2’, ‘rversions’, ‘git2r’
--2015-12-24 18:45:03-- https://cran.rstudio.com/src/contrib/xml2_0.1.2.tar.gz
Resolving cran.rstudio.com... 54.192.24.253
Connecting to cran.rstudio.com|54.192.24.253|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 74808 (73K) [application/x-gzip]
Saving to: ‘/tmp/Rtmp8EhLy0/downloaded_packages/xml2_0.1.2.tar.gz’
0K .......... .......... .......... .......... .......... 68% 104K 0s
50K .......... .......... ... 100% 2.96M=0.5s
(download)
(download)
(etc.)
ERROR: this R is version 3.0.1, package 'xml2' requires R >= 3.1.0
Warning in install.packages :
installation of package ‘xml2’ had non-zero exit status
ERROR: this R is version 3.0.1, package 'evaluate' requires R >= 3.0.2
Warning in install.packages :
installation of package ‘evaluate’ had non-zero exit status
ERROR: this R is version 3.0.1, package 'roxygen2' requires R >= 3.0.2
Warning in install.packages :
installation of package ‘roxygen2’ had non-zero exit status
ERROR: this R is version 3.0.1, package 'git2r' requires R >= 3.0.2
Warning in install.packages :
installation of package ‘git2r’ had non-zero exit status
ERROR: dependency ‘xml2’ is not available for package ‘rversions’
* removing ‘/home/haitam/R/x86_64-pc-linux-gnu-library/3.0/rversions’
Warning in install.packages :
installation of package ‘rversions’ had non-zero exit status
ERROR: this R is version 3.0.1, package 'devtools' requires R >= 3.0.2
Warning in install.packages :
installation of package ‘devtools’ had non-zero exit status
The downloaded source packages are in
‘/tmp/Rtmp8EhLy0/downloaded_packages’
似乎在安装时,R版本是默认版本,即3.0.1。然后我打开了Tools / shell并尝试了:
bash-4.2$ R --version
R version 3.0.1 (2013-05-16) -- "Good Sport"
Copyright (C) 2013 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under the terms of the
GNU General Public License versions 2 or 3.
For more information about these matters see
http://www.gnu.org/licenses/.
因此。我怎样才能克服R版本的这种混乱。我错过了什么。我必须设置配置文件或ENV变量吗?应该是在rstudio安装期间(cmake)?
提前谢谢