????????因?yàn)橹匮b了系統(tǒng),所以cocoapods也要重新裝便监,所以記錄下遇到的坑扎谎,真的是坑。網(wǎng)上找了很多資料烧董,含淚弄了好幾天毁靶。。發(fā)覺網(wǎng)上資料有些都過時(shí)了逊移,所以自己整理下预吆。
[!] Error installing SDWebImage[!] /usr/bin/git clone https://github.com/rs/SDWebImage.git /var/folders/pd/stntxywd0jx1fvws8fhj41tw0000gn/T/d20180727-6706-60dyxb --template= --single-branch --depth 1 --branch 4.0.0Cloning into '/var/folders/pd/stntxywd0jx1fvws8fhj41tw0000gn/T/d20180727-6706-60dyxb'...error: RPC failed; curl 56 LibreSSL SSL_read: SSL_ERROR_SYSCALL, errno 54fatal: The remote end hung up unexpectedlyfatal: early EOFfatal: index-pack failed
這個(gè)坑是因?yàn)閜od install遇到,最后知道因?yàn)槲议_了vpn胳泉,關(guān)掉再pod install就可以了拐叉。。
[!] Error installing MBProgressHUD[!] /usr/bin/git clone https://github.com/matej/MBProgressHUD.git /var/folders/pd/stntxywd0jx1fvws8fhj41tw0000gn/T/d20180801-15423-eucoy0 --template= --single-branch --depth 1 --branch 1.0.0Cloning into '/var/folders/pd/stntxywd0jx1fvws8fhj41tw0000gn/T/d20180801-15423-eucoy0'...error: RPC failed; curl 56 LibreSSL SSL_read: SSL_ERROR_SYSCALL, errno 60fatal: The remote end hung up unexpectedly
執(zhí)行$:xcode-select -p,打印結(jié)果如下:/Applications/Xcode.app/Contents/Developer扇商,再執(zhí)行$:sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer
[!] CocoaPods could not find compatible versions for pod "Masonry":? In Podfile:? ? Masonry (~> 1.1.0)None of your spec sources contain a spec satisfying the dependency: `Masonry (~> 1.1.0)`.You have either:?* out-of-date source repos which you can update with `pod repo update` or with `pod install --repo-update`.?* mistyped the name or version.?* not added the source repo that hosts the Podspec to your Podfile.Note: as of CocoaPods 1.0, `pod repo update` does not happen on `pod install` by default.
這個(gè)坑是clone的一個(gè)項(xiàng)目巷嚣,然后執(zhí)行pod install遇到。主要還是~/.cocoapods/repos文件下的master的問題钳吟,可以執(zhí)行pod setup廷粒,不過我從沒成功過,所以要Git clone https://git.coding.net/CocoaPods/Specs.git ~/.cocoapods/repos/master红且,或者下載好master文件(這個(gè)文件好大坨的)然后移動(dòng)到~/.cocoapods/repos下坝茎。
[!] CocoaPods could not find compatible versions for pod "Masonry": ? In snapshot (Podfile.lock): ? ? Masonry (= 1.1.0, ~> 1.1.0) ? In Podfile: ? ? Masonry (~> 1.1.0) None of your spec sources contain a spec satisfying the dependencies: `Masonry (~> 1.1.0), Masonry (= 1.1.0, ~> 1.1.0)`. You have either: ?* out-of-date source repos which you can update with `pod repo update` or with `pod install --repo-update`. ?* mistyped the name or version. ?* not added the source repo that hosts the Podspec to your Podfile. Note: as of CocoaPods 1.0, `pod repo update` does not happen on `pod install` by default.
這個(gè)也是clone來的項(xiàng)目執(zhí)行pod install的,把.xcworkspace和Podfile.lock文件刪除暇番,重新pod install一下就好了嗤放。猜測是不是不通版本或者系統(tǒng)造成的。
[!] Error installing SDWebImage [!] /usr/bin/git clone https://github.com/rs/SDWebImage.git /var/folders/pd/stntxywd0jx1fvws8fhj41tw0000gn/T/d20180801-17253-133nbmi --template= --single-branch --depth 1 --branch 3.8.2 Cloning into '/var/folders/pd/stntxywd0jx1fvws8fhj41tw0000gn/T/d20180801-17253-133nbmi'... fatal: unable to access 'https://github.com/rs/SDWebImage.git/': LibreSSL SSL_read: SSL_ERROR_SYSCALL, errno 54
這是在執(zhí)行pod install之后發(fā)生的壁酬,解決辦法:sudo gem install cocoapods次酌,接著再pod install恨课,就成功了。
git clone early EOF error
git config --global core.compression -1
fatal: The remote end hung up unexpectedly
將http.postBuffer設(shè)置的盡量大岳服,例如git config --global http.postBuffer 524288000 ?(500M)
git config --global http.postBuffer?1048576000 ?(1G)
ERROR: Error installing cocoapods: activesupport requires Ruby version >= 2.2.2.
更新ruby
ERROR: While executing gem … (Errno::EPERM) Operation not permitted - /usr/bin/xcodeproj
sudo gem install -n /usr/local/bin cocoapods
[!] /bin/bash -c set -eVERSION="1.0.2j"SDKVERSION=`xcrun --sdk iphoneos --show-sdk-version 2> /dev/null`MIN_SDK_VERSION_FLAG="-miphoneos-version-min=7.0"BASEPATH="${PWD}"CURRENTPATH="/tmp/openssl"ARCHS="i386 x86_64 armv7 armv7s arm64"DEVELOPER=`xcode-select -print-path`mkdir -p "${CURRENTPATH}"mkdir -p "${CURRENTPATH}/bin"cp "file.tgz" "${CURRENTPATH}/file.tgz"cd "${CURRENTPATH}"tar -xzf file.tgzcd "openssl-${VERSION}"for ARCH in ${ARCHS}do CONFIGURE_FOR="iphoneos-cross" if [ "${ARCH}" == "i386" ] || [ "${ARCH}" == "x86_64" ] ; then PLATFORM="iPhoneSimulator" if [ "${ARCH}" == "x86_64" ] ; then CONFIGURE_FOR="darwin64-x86_64-cc" fi else sed -ie "s!static volatile sig_atomic_t intr_signal;!static volatile intr_signal;!" "crypto/ui/ui_openssl.c" PLATFORM="iPhoneOS" fi export CROSS_TOP="${DEVELOPER}/Platforms/${PLATFORM}.platform/Developer" export CROSS_SDK="${PLATFORM}${SDKVERSION}.sdk" echo "Building openssl-${VERSION} for ${PLATFORM} ${SDKVERSION} ${ARCH}" echo "Please stand by..." export CC="${DEVELOPER}/usr/bin/gcc -arch ${ARCH} ${MIN_SDK_VERSION_FLAG}" mkdir -p "${CURRENTPATH}/bin/${PLATFORM}${SDKVERSION}-${ARCH}.sdk" LOG="${CURRENTPATH}/bin/${PLATFORM}${SDKVERSION}-${ARCH}.sdk/build-openssl-${VERSION}.log" LIPO_LIBSSL="${LIPO_LIBSSL} ${CURRENTPATH}/bin/${PLATFORM}${SDKVERSION}-${ARCH}.sdk/lib/libssl.a" LIPO_LIBCRYPTO="${LIPO_LIBCRYPTO} ${CURRENTPATH}/bin/${PLATFORM}${SDKVERSION}-${ARCH}.sdk/lib/libcrypto.a" ./Configure ${CONFIGURE_FOR} --openssldir="${CURRENTPATH}/bin/${PLATFORM}${SDKVERSION}-${ARCH}.sdk" > "${LOG}" 2>&1 sed -ie "s!^CFLAG=!CFLAG=-isysroot ${CROSS_TOP}/SDKs/${CROSS_SDK} !" "Makefile" make >> "${LOG}" 2>&1 make all install_sw >> "${LOG}" 2>&1 make clean >> "${LOG}" 2>&1doneecho "Build library..."rm -rf "${BASEPATH}/lib/"mkdir -p "${BASEPATH}/lib/"lipo -create ${LIPO_LIBSSL} -output "${BASEPATH}/lib/libssl.a"lipo -create ${LIPO_LIBCRYPTO} -output "${BASEPATH}/lib/libcrypto.a"echo "Copying headers..."rm -rf "${BASEPATH}/opensslIncludes/"mkdir -p "${BASEPATH}/opensslIncludes/"cp -RL "${CURRENTPATH}/openssl-${VERSION}/include/openssl" "${BASEPATH}/opensslIncludes/"cd "${BASEPATH}"echo "Building done."echo "Cleaning up..."rm -rf "${CURRENTPATH}"echo "Done."cp: file.tgz: No such file or directory
這是安裝OpenSSL(RSA加密)所用的庫用cocoapods安裝時(shí)遇到的坑剂公,大概意思就是路徑不對(duì),然后找了好久吊宋,終于用如下方法搞定:
1 設(shè)置header search paths纲辽,用pods是"${PODS_ROOT}/Headers/Public/OpenSSL"
2 設(shè)置Always Search User Paths(Deprecated) 為YES
順便貼一點(diǎn)可能用到的命令:
Mac os 11以后的話安裝cocoapods
$ sudo gem install -n /usr/local/bin?cocoapods
cocoapods master移除:
$ sudo rm -fr ~/.cocoapods/repos/master?
替代pod setup:
$ git clone https://git.coding.net/CocoaPods/Specs.git? ~/.cocoapods/repos/master
$ pod repo update
pod安裝與否查詢(1為安裝成功,0為不成功)
$ pod repo list?
清空全局緩存
$ sudo rm -fr ~/Library/Caches/CocoaPods/
$ sudo rm -fr ~/.cocoapods/repos/master/
$ sudo rm -fr Pods/
很久沒更新璃搜,發(fā)現(xiàn)系統(tǒng)升級(jí)之后拖吼,pod install 不能用了,會(huì)報(bào)如下錯(cuò)誤:
-bash: /usr/local/bin/pod: /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/bin/ruby: bad interpreter: No such file or directory
需要執(zhí)行:
sudo gem install -n /usr/local/bin cocoapods
待補(bǔ)充...
因?yàn)槭鞘潞蟛庞涗浀恼馕牵杂行┛記]有截圖或者文字記錄了吊档,還有的解決完忘記記錄,甚至可能有遺漏和錯(cuò)誤唾糯。怠硼。。希望有道友可以評(píng)論補(bǔ)充以幫助更多踩坑人~
其他大佬踩坑記錄:
使用cocoaPods時(shí)出現(xiàn)一些問題的解決方法
CocoaPods安裝趾断、卸載、使用說明(Mac ox 10.11+)
rvm吩愧、Ruby環(huán)境和CocoaPods安裝使用及相關(guān)報(bào)錯(cuò)問題解決
解決CocoaPods各種慢的方案(gem換源+pod repo換源)
cocoapod重裝的話參考鏈接:
2017/10/1更新之MAC安裝CocoaPods流程詳解
溫馨提醒芋酌,可以不用完全按照步驟,比如ruby已經(jīng)裝了且是最新的了雁佳,就沒必要再去重裝更新了脐帝。