升级后,pod install /pod update 报错,提示错误:
bash: /usr/local/bin/pod: /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby: bad interpreter: No such file or directory
解决:
1,升级gem
sudo gem update --system
报错:(注1)
ERROR: While executing gem ... (Gem::RemoteFetcher::UnknownHostError)
timed out (https://api.rubygems.org/specs.4.8.gz)
解决:使用代理升级
sudo gem update --system --http-proxyhttp://x.x.x.x:8000
2,重新安装cocoapods
sudo gem install -n /usr/local/bin cocoapods
报错:(注1),download超时
解决:使用代理
sudo gem install -n /usr/local/bin cocoapods --http-proxyhttp://x.x.x.x:8000
安装成功。
pod init ,生成podfile,里面 pod rxswift,下面是podfile内容
# Uncomment the next line to define a global platform for your project
platform :ios,'9.0'
target'name'do
# Comment the next line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!
# Pods for name
pod'Moya/RxSwift'
pod'RxSwift','~> 4.0.0'
target'nameTests'do
inherit! :search_paths
# Pods for testing
end
target'nameUITests'do
inherit! :search_paths
# Pods for testing
end
end
使用pod isntall ,你妹,报错
[!] Unable to satisfy the following requirements:
- `Firebase/Core` required by `Podfile`
None of your spec sources contain a spec satisfying the dependency: `Firebase/Core`.
You have either:
* out-of-date source repos which you can update with `pod 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.
看错误提示是Podfile里面导入的相应版本库,他找不到,我擦~~~
github上明明已经更新到某个版本。
可能CocoaPods版本太老了,pod --version ,13.1,
// 更新到最新的预览版,一次到底
sudo gem install cocoapods --pre
怕有缓存
// 移除本地master
sudo rm -fr ~/.cocoapods/repos/master
// 移除本地缓存
sudo rm -fr ~/Library/Caches/CocoaPods/
再次,pod install。OK