为什么 R 提示我并在 `update.packages()` 上失败?

Why is R prompting me and failing on `update.packages()`?

我是 R 的新手,我自己在 Ubuntu 14.04.3 (x64) 上编译了它。请注意,我是最新的 R 源代码:

blong@work:~/Documents/Work/REPOS__svn/R/R-3-2-branch$ svn info |head -n 7
Path: .
Working Copy Root Path: /home/blong/Documents/Work/REPOS__svn/R/R-3-2-branch
URL: https://svn.r-project.org/R/branches/R-3-2-branch
Relative URL: ^/branches/R-3-2-branch
Repository Root: https://svn.r-project.org/R
Repository UUID: 00db46b3-68df-0310-9c12-caf00c1e9a41
Revision: 69384
blong@work:~/Documents/Work/REPOS__svn/R/R-3-2-branch$ svn status -u
Status against revision:  69392
R 的 3.2.2 分支中的

运行 configuremake 已成功完成,我可以在 R 会话中使用各种包。但是,我想检查我的所有库是否都是最新的。在 R 3.2.2 中,我正在调用 update.packages()。调用该函数时,系统提示我 select 一个 CRAN 镜像:

假设一切都很好并且这不是问题,我 select 对话框中的主要 ("O-Cloud [https]") 镜像。对话框关闭,我返回到我的 R 提示符,并显示一条重复消息“unsupported URL scheme”。

同时,我在调用 update.packages() 时在我的 R 会话中收到一个错误:

> getOption("repos")
    CRAN 
"@CRAN@" 
> update.packages()
--- Please select a CRAN mirror for use in this session ---
Error in download.file(url, destfile = f, quiet = TRUE) : 
  unsupported URL scheme
Warning: unable to access index for repository https://cran.rstudio.com/src/contrib:
  unsupported URL scheme
> 

考虑到这可能是 HTTPS 的问题,我尝试了一个非 SSL 镜像,但同样没有任何反应(可能没有更新,但我想要一条消息告诉我这一点)。但是,这次我在对话框关闭后没有收到第二条 "unsupported URL scheme" 消息:

> update.packages()
--- Please select a CRAN mirror for use in this session ---
Error in download.file(url, destfile = f, quiet = TRUE) : 
  unsupported URL scheme
> 

似乎在幕后,R 使用一个名为 RCurl 的库来完成它的一些 HTTP/S 交互。据我所知,我使用的是受支持的 curl / libcurl 版本:

blong@work:~$ curl --version
curl 7.35.0 (x86_64-pc-linux-gnu) libcurl/7.35.0 OpenSSL/1.0.1f zlib/1.2.8 libidn/1.28 librtmp/2.3
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtmp rtsp smtp smtps telnet tftp 
Features: AsynchDNS GSS-Negotiate IDN IPv6 Largefile NTLM NTLM_WB SSL libz TLS-SRP 

对此有什么想法吗?它看起来与此类似 mailing list discussion,但我不确定这是一个问题还是我做错了什么。

好吧,我不觉得自己很傻。我的 C/C++ 背景不是很强。所以 make 除了遵循指南等之外,我并不真正在驾驶室内。

我和一位同事一起研究了这个,我们讨论了我在我的机器上配置 R 所采取的步骤。实际上我是这样做的:

svn checkout https://svn.r-project.org/R/branches/R-3-2-branch ~/R-3-2-branch
mkdir ~/R-3-2-branch.build
cd ~/R-3-2-branch.build
../R-3-2-branch/configure # Returns successfully
make

一切就绪,对吧? :) 我一定是,因为我可以使用 ~/R-3-2-branch.build/bin/R 并且该 R 会话中的所有内容(除了提示此问题的上述错误之外)似乎工作正常。我已经安装了来自 CRAN、Bioconductor 和 GitHub 的各种东西;很明显,问题一定出在其他地方。

哦,另外,我很确定所有依赖项都正确可用(就平台依赖项而言),因为我这样做了:

blong@work:~$ sudo apt-get build-dep r-base

嗯,是的,这是另外一回事!我忘了运行sudo make install

我承认,我不完全确定我执行的顺序是 configureapt-get build-dep r-basemake。但是,忘记 sudo make install 似乎是罪魁祸首。

这一次,我完成了完整的序列:

blong@work:~$ cd ~/R-3-2-branch.build
blong@work:~$ ../R-3-2-branch/configure
blong@work:~$ make
blong@work:~$ sudo make install

而且 R 中的一切似乎 运行 都非常愉快:

> update.packages()
--- Please select a CRAN mirror for use in this session ---
> 

(出现提示时,我选择了 O-Cloud [https] 镜像)

感谢大家的帮助!