更新:
我编写了一个关于在windows上安装Rtools的简要演练指南。
原版:
我试图在Windows 7上使用RStudio构建一个R包。当我试图通过RStudio的构建面板构建这个包时,我会收到:
WARNING: Rtools is required to build R packages but is not currently installed. Please download and install the appropriate version of Rtools before proceeding:
http://cran.rstudio.com/bin/windows/Rtools/
加载library(devtools)
并运行find_rtools(T)
提供:
Scanning path...
ls : F:\Rtools\bin\ls.exe
Scanning registry...
Found F:/Rtools for 3.1
VERSION.txt
Rtools version 3.1.0.1936
[1] TRUE
Path变量设置为:
F:\Rtools\bin;F:\Rtools\gcc-4.6.3\bin;F:\Rtools\perl\bin;F:\Rtools\MinGW\bin;F:\Program Files\R\R-3.0.2\bin\x64;F:\Program Files (x86)\HTML Help Workshop;F:\Program Files\MiKTeX 2.9\miktex\bin\x64\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\Common Files\Microsoft Shared\Windows Live;C:\Program Files (x86)\Common Files\Microsoft Shared\Windows Live;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Windows Live\Shared;C:\Program Files\Microsoft Network Monitor 3\;F:\Program Files (x86)\QuickTime\QTSystem\
我也重新启动了几次,但是错误仍然存在。我有点搞不懂为什么会发生这种事。
R访问系统变量路径时的输出:
> Sys.getenv()['PATH']
PATH
"F:\\Program Files\\R\\R-3.0.2\\bin\\x64;F:\\Rtools\\bin;F:\\Rtools\\gcc-4.6.3\\bin;F:\\Rtools\\perl\\bin;F:\\Rtools\\MinGW\\bin;F:\\Program Files\\R\\R-3.0.2\\bin\\x64;F:\\Program Files (x86)\\HTML Help Workshop;F:\\Program Files\\MiKTeX 2.9\\miktex\\bin\\x64\\;C:\\Program Files (x86)\\NVIDIA Corporation\\PhysX\\Common;C:\\Program Files\\Common Files\\Microsoft Shared\\Windows Live;C:\\Program Files (x86)\\Common Files\\Microsoft Shared\\Windows Live;C:\\Windows\\system32;C:\\Windows;C:\\Windows\\System32\\Wbem;C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\;C:\\Program Files (x86)\\Windows Live\\Shared;C:\\Program Files\\Microsoft Network Monitor 3\\;F:\\Program Files (x86)\\QuickTime\\QTSystem\\"
我使用的R版本是:R版本3.0.2 (2013-09-25) --“飞盘航行”。
我使用的Rstudio版本是: 0.97.551。当我检查更新时,我被告知这是最新的补丁。
> Sys.which("ls.exe")
ls.exe
"F:\\Rtools\\bin\\ls.exe"
> Sys.which("gcc.exe")
gcc.exe
""
发布于 2013-11-14 05:20:17
结果,当我安装RTools时,我忽略了安装中的R 2.15.x+工具链选项,这导致gcc从未被安装。希望如果RStudio没有注册RTools,这篇文章将作为诊断指南。
谢谢大家的帮助。
发布于 2014-02-20 05:53:41
默认情况下,Windows上的RTools安装不会选择要包含的C编译器。我盲目地运行了几次安装,并得到了这个错误。我重新运行安装程序并选择/包括32位和64位C编译器。问题解决了。
发布于 2019-01-24 00:34:19
我也犯了同样的错误,我安装了工具链(我相信)。
我的修正是将R工具路径移动到我的PATH
变量的前面。
https://stackoverflow.com/questions/19885381
复制相似问题