2013-10-30 79 views
5

我想從github安裝一個軟件包,但當我使用install_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 

我試圖安裝幾個不同的包 (包括ggmap的更新版本),我總是得到同樣的錯誤。它 必須與RCurl有關,但我不明白問題 是什麼,或者如何解決它。我有devtools(版本1.3)和RCurl (版本1.95-4.1)。我在Mac上運行R版本3.0.1(「Good Sport」)。從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 
+0

看起來像一個RCurl問題。這個文件是否真的存在:/Library/Frameworks/R.framework/Versions/3.0/Resources/library/RCurl/CurlSSL/cacert.pem? – Thomas

+0

嗯,在mac上適合我,10.8.5。這個安裝rcharts的評論可能是有用的https://github.com/ramnathv/rCharts/issues/135#issuecomment-20140615 – sckott

+0

是的,@Thomas說,你有沒有安裝libcurl?嘗試在命令行上找到curl-config,看看它是否安裝,如果沒有在這裏安裝的方向http://www.omegahat.org/RCurl/FAQ.html雖然也許你不能安裝RCurl沒有curl已經安裝... – sckott

回答

1

結果會這樣回答(R - devtools Github install fails)到類似的問題,建議嘗試重新安裝RCurl - 這(我猜在這裏)可能會解決路徑捲曲你的機器上,在任何情況,請嘗試。

1

在我的情況下,我的CAfile存在,但是是0字節。我通過運行修復了這個問題

update-ca-trust 

其中創建了正確的文件。