記錄一下,也許能幫到一些人
今天安裝devtools包時(shí)總是報(bào)錯(cuò),提示gert包配置錯(cuò)誤ERROR: configuration failed for package ‘gert’承冰,進(jìn)一步研究報(bào)錯(cuò)發(fā)現(xiàn)是缺少libgit2包坠陈,搜了一下不少人遇到過(guò)這個(gè)問(wèn)題刃唤,解決答案也是五花八門结啼,又要求sudo還要配置環(huán)境,搞不好要被管理員請(qǐng)喝茶沮榜。我試著用conda裝了一下盘榨,竟然成功了!“偏方治大病”啊蟆融。草巡。。(投機(jī)取巧而已型酥,不推薦這樣解決問(wèn)題)
具體:(我用的是miniconda3)
source activate R3.6.3
conda install libgit2
Collecting package metadata (current_repodata.json): done
Solving environment: done
## Package Plan ##
environment location: ****/miniconda3/envs/R3.6.1
added / updated specs:
- libgit2
The following packages will be downloaded:
package | build
---------------------------|-----------------
libgit2-1.1.0 | h3974521_1 667 KB conda-forge
pcre2-10.36 | h032f7d1_1 1.1 MB conda-forge
------------------------------------------------------------
Total: 1.8 MB
The following NEW packages will be INSTALLED:
libgit2 conda-forge/linux-64::libgit2-1.1.0-h3974521_1
pcre2 conda-forge/linux-64::pcre2-10.36-h032f7d1_1
Proceed ([y]/n)? y
Downloading and Extracting Packages
libgit2-1.1.0 | 667 KB | ################################################################################################################################################ | 100%
pcre2-10.36 | 1.1 MB | ################################################################################################################################################ | 100%
Preparing transaction: done
Verifying transaction: done
Executing transaction: done
libgit2安裝成功山憨。
然后在R中正常安裝gert,usethis弥喉,devtools郁竟。