R中devtools调用CURL遇证书吊销检查失败问题求助
在R中安装rkdb包时遇到curl证书吊销检查失败问题
问题详情
执行devtools::install_local("C:/Users/mathi/Downloads/rkdb-master")安装本地rkdb包时,安装流程会自动调用curl命令下载k.h文件:
curl -O -J -L https://github.com/KxSystems/kdb/raw/master/c/c/k.h
但执行时出现证书吊销检查失败的错误:
curl: (35) schannel: next InitializeSecurityContext failed: Unknown error (0x80092012) - The revocation function was unable to check revocation for the certificate.
手动给curl添加-k参数(跳过证书验证)可以成功下载k.h:
curl -k -O -J -L https://github.com/KxSystems/kdb/raw/master/c/c/k.h
但无法让R在安装流程中自动使用该带参数的命令,导致编译失败。
完整安装日志
> devtools::install_local("C:/Users/mathi/Downloads/rkdb-master") ── R CMD build ─────────────────────────────────────────────────────────────────────────────────────────────────────────── ✔ checking for file 'C:\Users\mathi\AppData\Local\Temp\Rtmp8uglEV\file321424d56a31\rkdb-master/DESCRIPTION' (1s) ─ preparing 'rkdb': ✔ checking DESCRIPTION meta-information ... ─ cleaning src ─ checking for LF line-endings in source and make files and shell scripts ─ checking for empty or unneeded directories Removed empty directory 'rkdb/c/c' Removed empty directory 'rkdb/c' ─ building 'rkdb_0.13.0.tar.gz' Installing package into ‘C:/Users/mathi/Local/R/win-library/4.2’ (as ‘lib’ is unspecified) * installing *source* package 'rkdb' ... ** using staged installation ** libs curl -O -J -L https://github.com/KxSystems/kdb/raw/master/c/c/k.h % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0 curl: (35) schannel: next InitializeSecurityContext failed: Unknown error (0x80092012) - The revocation function was unable to check revocation for the certificate. make: *** [Makevars:52: k.h] Error 35 ERROR: compilation failed for package 'rkdb' * removing 'C:/Users/mathi/Local/R/win-library/4.2/rkdb' Warning message: In i.p(...) : installation of package ‘C:/Users/mathi/Local/Temp/Rtmp8uglEV/file321456f43831/rkdb_0.13.0.tar.gz’ had non-zero exit status
解决方案
方法1:修改包内的Makevars文件
- 找到解压后的
rkdb-master目录,进入src文件夹,打开Makevars文件 - 定位到第52行左右的curl下载命令,将其修改为:
curl -k -O -J -L https://github.com/KxSystems/kdb/raw/master/c/c/k.h - 保存文件后,重新执行
devtools::install_local("C:/Users/mathi/Downloads/rkdb-master")
方法2:手动提供k.h文件
- 用带
-k参数的curl命令手动下载k.h文件到本地 - 将下载好的k.h文件复制到
rkdb-master/src目录下 - 再次执行安装命令,此时安装流程会跳过下载步骤,直接使用已有的k.h文件编译
方法3:临时设置R的curl全局选项
在执行安装命令前,先在R中设置curl默认带-k参数:
options(curl = "curl -k")
然后再执行devtools::install_local("C:/Users/mathi/Downloads/rkdb-master")
内容的提问来源于stack exchange,提问作者md0101
相关产品推荐
相关产品推荐

