错误设置证书验证位置,install_github

时间:2022-07-07 10:46:22

I am trying to install a package from github, but I keep getting an error when I use install_github.

我试图从github安装一个包,但是当我使用install_github时我一直收到错误。

library(devtools)
install_github(repo="swirl", username="ncarchedi")
Installing github repo(s) swirl/master from ncarchedi
Downloading swirl.zip from https://github.com/ncarchedi/swirl/archive/master.zip
Error in function (type, msg, asError = TRUE)  : 
  error setting certificate verify locations:
  CAfile: /Library/Frameworks/R.framework/Versions/3.0/Resources/library/RCurl/CurlSSL/cacert.pem
  CApath: none

I have tried to install several different packages (including an updated version of ggmap), and I always get the same error. It must have something to do with RCurl, but I don't understand what the problem is, or how to fix it. I have devtools (Version 1.3) and RCurl (Version 1.95-4.1). I am running R version 3.0.1 ("Good Sport") on mac.

我试图安装几个不同的包(包括ggmap的更新版本),我总是得到相同的错误。它必须与RCurl有关,但我不明白问题是什么,或者如何修复它。我有devtools(版本1.3)和RCurl(版本1.95-4.1)。我在mac上运行R版本3.0.1(“Good Sport”)。

Results from sessionInfo()

sessionInfo()的结果

sessionInfo()
R version 3.0.1 (2013-05-16)
Platform: x86_64-apple-darwin10.8.0 (64-bit)

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] RCurl_1.95-4.1 bitops_1.0-5   devtools_1.3  

loaded via a namespace (and not attached):
[1] digest_0.6.3   evaluate_0.4.3 httr_0.2       memoise_0.1    parallel_3.0.1  stringr_0.6.2 
[7] tools_3.0.1    whisker_0.3-2

4 个解决方案

#1


2  

This SO answer (R - devtools Github install fails) to a similar question suggests trying to reinstall RCurl - which (I'm guessing here) may fix the path to curl on your machine, in any case, try that.

这个SO答案(R - devtools Github安装失败)到类似的问题建议尝试重新安装RCurl - 我猜这里可能会修复你的机器卷曲的路径,无论如何,尝试。

#2


3  

In my case my CAfile existed but was 0 bytes. I fixed this by running

在我的情况下,我的CAfile存在,但是0字节。我通过运行来解决这个问题

update-ca-trust

which created the proper file.

它创建了正确的文件。

#3


3  

The problem is due to a change in the R package curl.

问题是由于R包卷曲的变化。

You can work around the issue as follows:

您可以按如下方式解决此问题:

1). Open a new MRO session and remove the packages curl and httr:

1)。打开一个新的MRO会话并删除包curl和httr:

remove.packages(c("curl","httr"))

2). Restart MRO and install the packages again, this time using install.packages() function:

2)。重新启动MRO并再次安装软件包,这次使用install.packages()函数:

install.packages(c("curl", "httr"))

3). Set the environment variable CURL_CA_BUNDLE:

3)。设置环境变量CURL_CA_BUNDLE:

Sys.setenv(CURL_CA_BUNDLE="/utils/microsoft-r-open-3.4.3/lib64/R/lib/microsoft-r-cacert.pem")

4). Try installing a package using install_github() from github(this should now work):

4)。尝试使用来自github的install_github()安装软件包(现在应该可以使用):

For example:

install_github("ropensci/tokenizer")

Reference:

rvest read_html function does not work

rvest read_html函数不起作用

#4


0  

I got this error while pushing changes to github
git config --global http.sslverify "false" will solve the problem

我在将更改推送到github git config时遇到此错误 - 全局http.sslverify“false”将解决问题

here is original discussion going on
https://github.com/npm/npm/issues/1484

这是原始讨论,请访问https://github.com/npm/npm/issues/1484

#1


2  

This SO answer (R - devtools Github install fails) to a similar question suggests trying to reinstall RCurl - which (I'm guessing here) may fix the path to curl on your machine, in any case, try that.

这个SO答案(R - devtools Github安装失败)到类似的问题建议尝试重新安装RCurl - 我猜这里可能会修复你的机器卷曲的路径,无论如何,尝试。

#2


3  

In my case my CAfile existed but was 0 bytes. I fixed this by running

在我的情况下,我的CAfile存在,但是0字节。我通过运行来解决这个问题

update-ca-trust

which created the proper file.

它创建了正确的文件。

#3


3  

The problem is due to a change in the R package curl.

问题是由于R包卷曲的变化。

You can work around the issue as follows:

您可以按如下方式解决此问题:

1). Open a new MRO session and remove the packages curl and httr:

1)。打开一个新的MRO会话并删除包curl和httr:

remove.packages(c("curl","httr"))

2). Restart MRO and install the packages again, this time using install.packages() function:

2)。重新启动MRO并再次安装软件包,这次使用install.packages()函数:

install.packages(c("curl", "httr"))

3). Set the environment variable CURL_CA_BUNDLE:

3)。设置环境变量CURL_CA_BUNDLE:

Sys.setenv(CURL_CA_BUNDLE="/utils/microsoft-r-open-3.4.3/lib64/R/lib/microsoft-r-cacert.pem")

4). Try installing a package using install_github() from github(this should now work):

4)。尝试使用来自github的install_github()安装软件包(现在应该可以使用):

For example:

install_github("ropensci/tokenizer")

Reference:

rvest read_html function does not work

rvest read_html函数不起作用

#4


0  

I got this error while pushing changes to github
git config --global http.sslverify "false" will solve the problem

我在将更改推送到github git config时遇到此错误 - 全局http.sslverify“false”将解决问题

here is original discussion going on
https://github.com/npm/npm/issues/1484

这是原始讨论,请访问https://github.com/npm/npm/issues/1484