Как исправить ошибки сертификата (curl) при использовании devtools в R - PullRequest
0 голосов
/ 01 июля 2019

Сейчас я работаю на Manjaro, работаю с Microsoft R Open 3.5. Я установил devtools для установки ITKR через

devtools::install_github("stnava/ITKR")

При этом я получаю сообщение об ошибке:

Downloading GitHub repo stnava/ITKR@master
curl: (77) error setting certificate verify locations:
  CAfile: r-cacert.pem
  CApath: none
Error in utils::download.file(url, path, method = download_method(), 
quiet = quiet,  : 
  'curl' call had nonzero exit status

Когда я читал другие вопросы, я решил эту проблему с помощью следующего кода (вызов options () выполнен, потому что devtools сообщает мне, что загруженный файл не является допустимым файлом tar).

Sys.setenv("CURL_CA_BUNDLE" = "/usr/lib/R/lib/microsoft-r-cacert.pem")
options(download.file.extra = paste0("-L ", getOption("download.file.extra", default = "")))

При повторном использовании devtools для установки ITKR загрузка начинается, но после нескольких загруженных файлов возвращается ошибка cacert.

> devtools::install_github("stnava/ITKR")
Downloading GitHub repo stnava/ITKR@master
✔  checking for file ‘/tmp/RtmpuipYyA/remotes83b43c925e6/stnava-ITKR-1b88aa6/DESCRIPTION’ ...
─  preparing ‘ITKR’:
✔  checking DESCRIPTION meta-information ...
─  cleaning src
─  running ‘cleanup’
─  checking for LF line-endings in source and make files and shell scripts
─  checking for empty or unneeded directories
─  looking to see if a ‘data/datalist’ file should be added
─  building ‘ITKR_0.5.0.tar.gz’

Installing package into ‘/home/clementpoiret/R/x86_64-pc-linux-gnu-library/3.5’
(as ‘lib’ is unspecified)
* installing *source* package ‘ITKR’ ...
Cloning into 'itks'...
remote: Enumerating objects: 58, done.
remote: Counting objects: 100% (58/58), done.
remote: Compressing objects: 100% (54/54), done.
remote: Total 449481 (delta 8), reused 11 (delta 4), pack-reused 449423
Receiving objects: 100% (449481/449481), 145.87 MiB | 589.00 KiB/s, done.
Resolving deltas: 100% (353286/353286), done.
Already on 'master'
Your branch is up to date with 'origin/master'.
Note: checking out 'f136bfe8bdb86c068ef1627ca2a5c02d5aa2fa24'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:

  git checkout -b <new-branch-name>

HEAD is now at f136bfe8bd BUG: Fix export for ITKDeprecated classes
Cloning into 'cmaker'...
remote: Enumerating objects: 12647, done.
remote: Total 12647 (delta 0), reused 0 (delta 0), pack-reused 12647
Receiving objects: 100% (12647/12647), 10.42 MiB | 591.00 KiB/s, done.
Resolving deltas: 100% (3402/3402), done.
* installing to library ‘/home/clementpoiret/R/x86_64-pc-linux-gnu-library/3.5’
* installing *source* package ‘cmaker’ ...
  % 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: (77) error setting certificate verify locations:
  CAfile: r-cacert.pem
  CApath: none
Error in download.file("https://cmake.org/files/v3.11/cmake-3.11.4.tar.gz",  : 
  'curl' call had nonzero exit status
Execution halted
Error in file(con, "rb") : 
  (converted from warning) cannot open file 'cmake-3.11.4.tar.gz': No such file or directory
Calls: <Anonymous> -> readBin -> file
Execution halted
cp: cannot stat 'src/cmake/Utilities/NoDartCoverage': No such file or directory
cp: cannot stat 'src/cmake/Utilities/cmexpat/NoDartCoverage': No such file or directory
cp: cannot stat 'src/cmake/Utilities/cmzlib/NoDartCoverage': No such file or directory
./configure: line 29: cd: ./src/cmake: No such file or directory
./configure: line 32: ./bootstrap: No such file or directory
** libs
g++ -std=gnu++11 -I/usr/lib/R/include -DNDEBUG   -DU_STATIC_IMPLEMENTATION   -fpic  -DU_STATIC_IMPLEMENTATION -g -O2 -c dummy.cpp -o dummy.o
cd cmake && make -j 2 && make install &&  cd ../ && rm -rf cmake
/bin/bash: line 0: cd: cmake: No such file or directory
make: *** [Makevars:8: libs] Error 1
ERROR: compilation failed for package ‘cmaker’
* removing ‘/home/clementpoiret/R/x86_64-pc-linux-gnu-library/3.5/cmaker’
Error in loadNamespace(name) : there is no package called ‘cmaker’
Calls: :: ... tryCatch -> tryCatchList -> tryCatchOne -> <Anonymous>
Execution halted
./configure: line 55: -DCMAKE_BUILD_TYPE:STRING=Release: command not found
** libs
g++ -std=gnu++11 -I/usr/lib/R/include -DNDEBUG  -I"/home/clementpoiret/R/x86_64-pc-linux-gnu-library/3.5/Rcpp/include" -DU_STATIC_IMPLEMENTATION   -fpic  -DU_STATIC_IMPLEMENTATION -g -O2 -c dummy.cpp -o dummy.o
cd itkb && make -j 2 && make install && rm -rf ../itks
make[1]: Entering directory '/tmp/RtmpmaGPS8/R.INSTALLb1978611788/ITKR/src/itkb'
make[1]: *** No targets specified and no makefile found.  Stop.
make[1]: Leaving directory '/tmp/RtmpmaGPS8/R.INSTALLb1978611788/ITKR/src/itkb'
make: *** [Makevars:8: libs] Error 2
ERROR: compilation failed for package ‘ITKR’
* removing ‘/home/clementpoiret/R/x86_64-pc-linux-gnu-library/3.5/ITKR’
Error in i.p(...) : 
  (converted from warning) installation of package ‘/tmp/RtmpuipYyA/file83b61ada88f/ITKR_0.5.0.tar.gz’ had non-zero exit status

При вызове Sys.getenv() CURL_CA_BUNDLE правильно установлено на /usr/lib/R/lib/microsoft-r-cacert.pem. Кроме того, я смог правильно установить muschellij2/fslr через devtools.

Знаете, как я могу решить эту проблему? Благодаря.

...