问题描述
更新:
我写了一个简短的演练指南来在 Windows 上安装 Rtools一>.
I've written a brief walkthrough guide to installing Rtools on windows.
原文:
我正在尝试在 Windows 7 上使用 RStudio 构建 R 包.当我尝试通过 RStudio 的构建面板构建包时,我收到:
I am trying to build an R package using RStudio on Windows 7. When I attempt to build the package via RStudio's Build panel I receive:
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)
给出:
Loading library(devtools)
and running find_rtools(T)
gives:
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 变量设置为:
The Path variable is set as:
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\
我也重新启动了几次,但错误仍然存在.我有点不明白为什么会这样.
I've also restarted several times, yet the error persists. I'm a bit confused as to why this is occurring.
R访问系统变量Path时的输出:
Output when R access system variable Path:
> 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 version 3.0.2 (2013-09-25) -- "Frisbee Sailing".
The R version I am using is: R version 3.0.2 (2013-09-25) -- "Frisbee Sailing."
我使用的 Rstudio 版本是:0.97.551.当我检查更新时,我被告知这是最新的补丁.
The Rstudio Version I am using is: 0.97.551. When I check for updates, I'm told that this is the latest patch.
> Sys.which("ls.exe")
ls.exe
"F:\\Rtools\\bin\\ls.exe"
> Sys.which("gcc.exe")
gcc.exe
""
推荐答案
事实证明,当我安装 RTools 时,我在安装中遗漏了 R 2.15.x+ 工具链选项,这导致 gcc 从未安装过.如果 RStudio 无法注册 RTools,希望这篇文章可以作为诊断指南.
Turns out when I installed RTools I left out the R 2.15.x+ toolchain option in the installation, which lead to the gcc never being installed. Hopefully, this post will serve as a diagnostic guide if RStudio fails to register RTools.
感谢大家的帮助.
这篇关于R 未检测到 Rtools的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!