1.安裝HomeBrew一直卡住
git fetch origin master:refs/remotes/origin/master --tags --force
參考方案:
http://www.reibang.com/p/c8d998903a6a
2./Users/xxxxx/.rbenv/shims/ruby: line 21: /usr/local/Cellar/rbenv/1.1.1/libexec/rbenv: No such file or directory
解決方案:
安裝 rbenv
brew install rbenv
3.升級(jí)MacOS ,或者升級(jí)Xcode,遇到
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require': cannot load such file -- xcodeproj (LoadError)
解決方案:
終端執(zhí)行 sudo gem install xcodeproj
4.長(zhǎng)時(shí)間未更新CocoaPods吨铸、或者升級(jí)了Mac OS感帅,導(dǎo)致pod install無效
報(bào)錯(cuò)
/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/bin/ruby: no such file or directory
解決方案:
sudo gem install -n /usr/local/bin cocoapods
這個(gè)過程需要時(shí)間比較久柄沮,需要耐心等待下;
執(zhí)行完后豌鸡,再執(zhí)行 pod install捧存,如果遇到
[!] CDN: trunk Repo update failed - 22 error(s):
在Podfile文件下添加下面,即可
source 'https://github.com/CocoaPods/Specs.git'
5.ReactNative 項(xiàng)目執(zhí)行npm install,報(bào)以gyp錯(cuò)誤
gyp: No Xcode or CLT version detected!
gyp ERR! configure error
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack at ChildProcess.onCpExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:345:16)
gyp ERR! stack at ChildProcess.emit (events.js:198:13)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:248:12)
gyp ERR! System Darwin 19.3.0
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/zhangxi/Desktop/YunCode/RNSummaryCode/node_modules/fsevents
gyp ERR! node -v v10.16.3
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
解決方案
sudo xcode-select -s /Applications/Xcode.app/Contents/Developer
6塔逃、更新自己維護(hù)的CocoaPods的庫(kù)時(shí)挖炬,執(zhí)行‘pod trunk push ZHXIndexView.podspec --allow-warnings ’ 遇到
[!] CDN: trunk Repo update failed - 2 error(s):
CDN: trunk URL couldn't be downloaded: https://raw.githubusercontent.com/CocoaPods/Specs/master/Specs/1/e/4/AFOAuth2Client/1.0.0/AFOAuth2Client.podspec.json Response: Couldn't connect to server
CDN: trunk URL couldn't be downloaded: https://raw.githubusercontent.com/CocoaPods/Specs/master/Specs/a/a/6/AFAmazonS3Client/2.0.1/AFAmazonS3Client.podspec.json Response: Couldn't connect to server
解決方案:
1揽浙、通過查iP的網(wǎng)站ipaddress,查找到raw.githubusercontent.com/對(duì)應(yīng)的IP;
2意敛、在本地host文件最后一行馅巷,添加
199.232.68.133(你自己查到的ip地址) raw.githubusercontent.com
3、重新執(zhí)行pod trunk push 即可草姻。