R devtools 无法使用 CURL

问题描述 投票:0回答:2

我对 R 中的 CURL 包有疑问

我正在尝试运行以下命令:

devtools::install_local("Downloads/rkdb-master")
其中 rkdb-master 是一个解压缩的 Git 包。这调用以下内容:

curl -O -J -L https://github.com/KxSystems/kdb/raw/master/c/c/k.h

然而,在运行CURL命令后,出现以下错误:

curl: (35) schannel: next InitializeSecurityContext failed: Unknown error (0x80092012) - The revocation function was unable to check revocation for the certificate.

有人可以帮我解决这个问题吗?

网上查了一下,建议是:

curl -k -O -J -L https://github.com/KxSystems/kdb/raw/master/c/c/k.h

这可以在本地安装 k.h 文件。但是,当我运行安装时,我不能强制 R 使用

curl -k -O -J -L https://github.com/KxSystems/kdb/raw/master/c/c/k.h
而不是
curl -O -J -L https://github.com/KxSystems/kdb/raw/master/c/c/k.h
.

> 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/AppData/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/AppData/Local/R/win-library/4.2/rkdb'
Warning message:
In i.p(...) :
  installation of package ‘C:/Users/mathi/AppData/Local/Temp/Rtmp8uglEV/file321456f43831/rkdb_0.13.0.tar.gz’ had non-zero exit status
r curl devtools
2个回答
1
投票

这对我来说和(更简单,更新的)一样好

remotes::install_github("kxsystems/rkdb")

一旦我确保我也安装了

curl
(二进制客户端)——当然也在安装其他依赖项之后。

curl
的使用对 KxSystems 来说有点不妥:R 现在使用
libcurl
构建,他们可以只依赖 R 自己的
download.file()
。无论如何...但是这里没有证书失败。

我的构建(在容器中,但在 Linux 上)显示

* installing *source* package ‘rkdb’ ...                                                                 
** using staged installation                                                                             
** libs                                                                                                  
UNAME_S="Linux"                                                                                          
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
100  4126  100  4126    0     0  10557      0 --:--:-- --:--:-- --:--:-- 10557
curl -O -J -L https://github.com/KxSystems/kdb/raw/master/l64/e.o
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100 85616  100 85616    0     0   210k      0 --:--:-- --:--:-- --:--:--  557k
gcc -I"/usr/share/R/include" -DNDEBUG     -D_GNU_SOURCE -fpic  -g -O2 -ffile-prefix-map=/build/r-base-LhKvHL/r-base-4.2.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2  -c rkdb.c -o rkdb.o  

之后它会继续出现轻微的编译警告。

(此外,您的主题在这里是错误的:

devtools
不依赖或使用
curl
rkdb
包中的安装配方确实是 KxSystems 问题。)


1
投票

我通过更改 CURL 的默认配置文件找到了解决方案。谢谢 Dirk Eddelbuettel 的提示。

对我有用的:

  1. 在命令行中,键入:
    touch .curlrc
    (这将为您的 CURL 创建一个默认配置文件 - 确保您没有或转到第 3 步)
  2. set %USERPROFILE%=C:/Users/username(我创建 .curlrc 的地方)
  3. 打开 .curlrc 并输入
    insecure
  4. remotes::install_github("kxsystems/rkdb") 现在应该可以工作了

希望这有帮助!

© www.soinside.com 2019 - 2024. All rights reserved.