devtools install_github安装报错: CAfile: microsoft-r-cacert.pem

报错信息

> install_github("dengfei2013/GS")
Installation failed: error setting certificate verify locations:
  CAfile: microsoft-r-cacert.pem
  CApath: none

解决方法

  1. 进入R, 卸载curl, httr, 重新安装
remove.packages(c("curl","httr"))
install.packages(c("curl", "httr"))
  1. 更换microsoft-r-cacert.pem
Sys.setenv(CURL_CA_BUNDLE="/opt/microsoft/ropen/3.5.1/lib64/R/lib/microsoft-r-cacert.pem")

里面是我的路径, 你可以通过locate ,查看你的pem路径, 进行替换

  1. 测试install_github
library(devtools)
install_github("dengfei2013/GS")
> install_github("dengfei2013/GS")    
Downloading GitHub repo dengfei2013/GS@master
from URL https://api.github.com/repos/dengfei2013/GS/zipball/master
Installing GS
'/root/anaconda3/lib/R/bin/R' --no-site-file --no-environ --no-save  \
  --no-restore --quiet CMD INSTALL  \
  '/tmp/RtmpdN5qFa/devtools2bc37ead1356/dengfei2013-GS-f560b6c'  \
  --library='/opt/microsoft/ropen/3.5.1/lib64/R/library' --install-tests 

* installing *source* package ‘GS’ ...
** R
** data
*** moving datasets to lazyload DB
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded
* DONE (GS)

搞定!

你可能感兴趣的:(R语言)