執(zhí)行pod命令時出現(xiàn)如上提示 如pod --version pod install gem source -l
等命令時 出現(xiàn)如下提示
Ignoring ffi-1.12.2 because its extensions are not built. Try: gem pristine ffi --version 1.12.2
解決方案:執(zhí)行命令:sudo gem install cocoapods-core
劃重點:sudo是linux系統(tǒng)管理指令禁荸,是允許系統(tǒng)管理員讓普通用戶執(zhí)行一些或者全部的root命令的一個工具
查看了下 pod版本為1.9.1 Homebrew版本為 2.5.6 gem版本為3.0.3
整個操作過程如下:
一吗铐、根據(jù)提示執(zhí)行命令:gem pristine ffi --version 1.12.2
依舊報錯
Ignoring ffi-1.12.2 because its extensions are not built. Try: gem pristine ffi --version 1.12.2 ERROR: While executing gem ... (Gem::FilePermissionError) You don't have write permissions for the /Library/Ruby/Gems/2.6.0 directory.
二、提示沒有write權限就漾,根據(jù)提示打開/Library/Ruby/Gems/2.6.0,果然是只讀權限
修改權限 再次執(zhí)行命令:gem pristine ffi --version 1.12.2
依舊報錯 提示權限被拒絕
Ignoring ffi-1.12.2 because its extensions are not built. Try: gem pristine ffi --version 1.12.2 Restoring gems to pristine condition... ERROR: While executing gem ... (Errno::EACCES) Permission denied @ rb_sysopen - /Library/Ruby/Gems/2.6.0/gems/ffi-1.12.2/.appveyor.yml
三氏淑、一臉懵逼的開始查找資料
參考鏈接:https://blog.csdn.net/shenyiyangnb/article/details/80897724
執(zhí)行命令:sudo gem install cocoapods-core
執(zhí)行成功之后再次執(zhí)行pod --version pod install gem source -l
等命令時就正常了
四湘换、然后繼續(xù)一臉懵逼 執(zhí)行命令gem pristine ffi --version 1.12.2
依舊權限不夠
解決方案:執(zhí)行命令時加上sudo sudo是linux系統(tǒng)管理指令仰担,是允許系統(tǒng)管理員讓普通用戶執(zhí)行一些或者全部的root命令的一個工具
sudo gem pristine ffi --version 1.12.2
輸入密碼 執(zhí)行成功
Password:
Restoring gems to pristine condition...
Building native extensions. This could take a while...
Restored ffi-1.12.2
然后會出現(xiàn)
Insecure world writable dir
的異常警告!
warning: Insecure world writable dir /usr/local in PATH, mode 040777
要去除這個警告玷氏,需要更改/usr/local的權限即可堵未,命令如下:
sudo chmod go-w /usr/local
整理自:http://www.reibang.com/p/8199ce31d5e5,http://www.reibang.com/p/d3c9919f453c