1、从git上拉取项目报如下错误:
网上搜了半天说是pod没安装,于是前去安装
2、安装过程
因为Ruby的默认源使用的是cocoapods.org 但在国内阻挡了 cocoapods.org,
可以将源换成淘宝的来解决这个问题,可以尝试换以下方法。
~ % ruby -v
ruby 2.6.3p62 (2019-04-16 revision 67580) [universal.x86_64-darwin19]
~ % gem sources --remove https://rubygems.org/
https://rubygems.org/ removed from sources
~ % gem sources -a http://ruby.taobao.org/
Error fetching http://ruby.taobao.org/:
server did not return a valid file (http://ruby.taobao.org/specs.4.8.gz)
i@**Mac-mini ~ % gem sources -a http://ruby.taobao.org/
Error fetching http://ruby.taobao.org/:
server did not return a valid file (http://ruby.taobao.org/specs.4.8.gz)
nuanmukeji@nuanmukejideMac-mini ~ % gem sources -l
报错淘宝镜像找不到,于是又进行了搜索,最终找到如下解决办法(不用淘宝镜像 ,用china)
~ % gem sources --add https://gems.ruby-china.com/
https://gems.ruby-china.com/ added to sources
~ % gem sources -l
*** CURRENT SOURCES ***
https://gems.ruby-china.com/
终于可以安装了
sudo gem install cocoapods
输入密码后安装成功
切换到项目根目录下;执行如下命令
% pod install
Analyzing dependencies
Adding spec repo `trunk` with CDN `https://cdn.cocoapods.org/`
Downloading dependencies
Installing AFNetworking (4.0.1)
Installing DZNEmptyDataSet (1.8.1)
Installing FLAnimatedImage (1.0.12)
Installing FMDB (2.7.5)
Installing IQKeyboardManager (6.5.6)
Installing MBProgressHUD (1.1.0)
Installing MJExtension (3.2.3)
Installing MJRefresh (3.5.0)
Installing Masonry (1.1.0)
Installing Ono (2.1.2)
Installing SDCycleScrollView (1.80)
Installing SDWebImage (5.9.3)
Installing TZImagePickerController (3.4.6)
Installing YBAttributeTextTapAction (3.0.3)
Installing YBImageBrowser (3.0.9)
Installing YYAsyncLayer (1.0)
Installing YYCache (1.0.4)
Installing YYCategories (1.0.4)
Installing YYImage (1.0.4)
Installing YYModel (1.0.4)
Installing YYText (1.0.7)
Installing YYWebImage (1.0.5)
Generating Pods project
Integrating client project
最终安装成功
项目运行成功