mac電腦 pod install時候遇到的一些問題
===========問題1============================
Mac 系統(tǒng)更新到 macOS Catalina 10.15 之后 發(fā)現(xiàn)pos install 報錯
-bash: /usr/local/bin/pod: /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/bin/ruby: bad
解決:
粗暴點派哲,直接重裝
sudo gem install cocoapods
執(zhí)行后還是報錯
ERROR: Could not find a valid gem 'cocoapods' (>= 0) in any repository
-------------------分割線-------------------------------------
輸入這段命令行就好了臼氨,輸入后會執(zhí)行一堆操作等著就好,然后直接pod install就成功了
sudo gem install cocoapods --source http://rubygems.org
參考
https://blog.csdn.net/liwenjie0912/article/details/102390598
https://blog.csdn.net/piyixia/article/details/96484677
===========問題2============================
cocopads更新庫時失敗芭届,報錯Failed to extract git version from ' git --version ' xcrun: error: invalid active developer path
最近 升級了一下電腦系統(tǒng) macOSMojave 10.14.1
順便升級了一下 Xcode Version 10.1 (10B61)
哭了 使用 cocosPods? 集成時 報錯
Mac:~mac$ pod-versionTraceback(most recent call last):5:from/usr/local/bin/pod:23:in`<main>'4:from/usr/local/bin/pod:23:in`load'3:from/Users/mac/.rvm/gems/ruby-2.5.1@global/gems/cocoapods-1.5.3/bin/pod:55:in`<top(required)>'2:from/Users/mac/.rvm/rubies/ruby-2.5.1/lib/ruby/gems/2.5.0/gems/cocoapods-1.5.3/lib/cocoapods/command.rb:49:in`run'1:from/Users/mac/.rvm/rubies/ruby-2.5.1/lib/ruby/gems/2.5.0/gems/cocoapods-1.5.3/lib/cocoapods/command.rb:130:in`verify_minimum_git_version!'/Users/mac/.rvm/rubies/ruby-2.5.1/lib/ruby/gems/2.5.0/gems/cocoapods-1.5.3/lib/cocoapods/command.rb:118:in`git_version':Failedto extract git versionfrom`git--version`("xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun\n")(RuntimeError)
分析:
Failed to extract git version from ' git --version ' xcrun: error: invalid active developer path
未能從git—version中提取 git 版本: 錯誤: 無效的活動開發(fā)路徑储矩;簡單來說就是Git工具不好使了。
通常做法就是打開 terminal 執(zhí)行 xcode-select --install
但由于我是 macOS 升級 所以這樣是不行的褂乍,需要到 Git 官網(wǎng)下載 Git 才可以:
https://git-scm.com/download/mac
下載完成后手動安裝 git 這樣就可以解決了 持隧!
鏈接:http://www.reibang.com/p/c882c8ffa79c
-------------------------------------------------------?
!L悠屡拨!以上方法網(wǎng)慢始終下載失敗,最后在終端直接打這個命令執(zhí)行完安裝就ok了
命令行執(zhí)行: xcode-select --install解決問題 . 重要的話說三遍!!!
==========問題3============================
問題描述
[!] Error installing Masonry
[!] /usr/bin/git clone https://github.com/cloudkite/Masonry.git /var/folders/0f/n8wwqx_166588q2rhp__r2wc0000gn/T/d20210313-14531-h9zipp --template= --single-branch --depth 1 --branch v1.1.0
Cloning into '/var/folders/0f/n8wwqx_166588q2rhp__r2wc0000gn/T/d20210313-14531-h9zipp'...
fatal: unable to access 'https://github.com/cloudkite/Masonry.git/': Failed to connect to github.com port 443: Operation timed out
試了各種方法都沒有效果
只有下邊這個方法解決了該問題
需要在finder 前往文件夾 打開 /etc/hosts 文件褥实,然后復(fù)制到本地
打開瀏覽器放入該鏈接
http://tool.chinaz.com/dns/?type=1&host=github.com&ip=
aaaaaa
然后復(fù)制到 hosts文件里 后面 加上 github.com 如下
bbbbbb
保存 然后 復(fù)制文件到 etc/hosts 覆蓋掉?
重新打開終端 cd到當(dāng)前目錄 執(zhí)行 pod install?
作者鏈接:http://www.reibang.com/p/869b2325bb74
==========問題4============================
pod安裝某個三方庫時候呀狼,失敗,看原因貌似時依賴某個指定版本
解決方法:刪除.workspace和.lock文件损离,重新執(zhí)行podinstall
Analyzing dependencies
[!] CocoaPods could not find compatible versions for pod "Masonry":
? In snapshot (Podfile.lock):
? ? Masonry (= 1.1.0)
? In Podfile:
? ? HYBMasonryAutoCellHeight was resolved to 2.0.1, which depends on
? ? ? Masonry (~> 0.6)
? ? Masonry
[!] Smart quotes were detected and ignored in your Podfile. To avoid issues in the future, you should not use TextEdit for editing it. If you are not using TextEdit, you should turn off smart quotes in your editor of choice.