<p style="font-family: Menlo; white-space: pre-wrap; margin-top: 0px; margin-bottom: 0px; line-height: normal;"><span style="font-size:18px;"><span style="line-height: normal; font-family: 'PingFang SC'; font-variant-ligatures: no-common-ligatures;">安装</span><span style="font-variant-ligatures: no-common-ligatures;">cocopods</span></span></p><p style="font-family: Menlo; white-space: pre-wrap; margin-top: 0px; margin-bottom: 0px; line-height: normal;"><span style="font-size:18px;"><strong>1.打开终端</strong></span></p><p style="font-family: Menlo; white-space: pre-wrap; margin-top: 0px; margin-bottom: 0px; line-height: normal;"><span style="font-size:18px;"><strong><span style="font-variant-ligatures: no-common-ligatures">2.cd </span><span style="line-height: normal; font-family: 'PingFang SC'; font-variant-ligatures: no-common-ligatures;">导入路径 // 可以直接将文件夹拖到中断路径自动填上</span></strong></span></p><p style="margin-top: 0px; margin-bottom: 0px; line-height: normal;"><span style="font-variant-ligatures: no-common-ligatures;"><span style="font-size:18px;"><span style="font-family:Menlo;"><span style="white-space: pre-wrap;"><strong>3.touch Podfile // 生成pod file 文件</strong></span></span></span></span></p><p style="margin-top: 0px; margin-bottom: 0px; line-height: normal;"><span style="font-variant-ligatures: no-common-ligatures;"><span style="font-size:18px;"><span style="font-family:Menlo;"><span style="white-space: pre-wrap;"><strong>4.在podfile 文件里写你要装的库文件</strong></span></span></span></span></p><p style="margin-top: 0px; margin-bottom: 0px; line-height: normal;"><span style="font-variant-ligatures: no-common-ligatures;"><span style="font-size:18px;"><span style="font-family:Menlo;"><span style="white-space: pre-wrap;">例:platform :ios, '7.0' pod 'AFNetworking' pod 'SDWebImage' pod 'FMDB' pod 'TPKeyboardAvoiding' pod 'MJRefresh'</span></span></span></span></p><p style="margin-top: 0px; margin-bottom: 0px; line-height: normal;"><span style="font-variant-ligatures: no-common-ligatures;"><span style="font-size:18px;"><span style="font-family:Menlo;"><span style="white-space: pre-wrap;">// 不写后面版本,默认下载最新的</span></span></span></span></p><p style="margin-top: 0px; margin-bottom: 0px; line-height: normal;"><strong><span style="font-family:Menlo;font-size:18px;"><span style="white-space: pre-wrap;">6.</span></span><span style="font-size:18px; font-family: Menlo; white-space: pre-wrap;">pod install // 就会安装库</span></strong></p><span style="font-family: arial, 'courier new', courier, 宋体, monospace, 'Microsoft YaHei'; white-space: pre-wrap;"><strong><span style="font-size:18px;color:#330033;">pod install 被卡住:Updating local specs repositories 被强了, 我用 </span></strong></span><span style="font-family: arial, 'courier new', courier, 宋体, monospace, 'Microsoft YaHei'; white-space: pre-wrap; color: rgb(51, 0, 51);font-size:18px; font-weight: bold;">pod install --verbose --no-repo-update</span><span style="font-family: arial, 'courier new', courier, 宋体, monospace, 'Microsoft YaHei'; white-space: pre-wrap;"><strong><span style="font-size:18px;color:#330033;"> </span></strong><span style="color: rgb(70, 70, 70); font-size: 14px;"> </span></span>
<span style="font-family: arial, 'courier new', courier, 宋体, monospace, 'Microsoft YaHei'; white-space: pre-wrap;"><span style="color: rgb(70, 70, 70); font-size: 14px;">// </span><span style="font-size:18px;color:#330033;"><strong>如果出现</strong></span></span><h1 id="subject_tpc" style="outline: none; margin: 0px 0px 15px 15px; padding: 0px; line-height: 1; font-family: 'Helvetica Neue', Helvetica, STheiti, 微软雅黑, 黑体, Arial, Tahoma, sans-serif, serif;"><span style="font-size:18px;color:#330033;">执行pod install时提示-bash: pod: command not found </span><span style="font-weight: normal; font-size: 16px; color: rgb(51, 102, 204);"> </span></h1>
<span style="font-size:18px;"><strong>可能是cocoa pods 没装好</strong></span><span style="font-size:18px;"><strong>重装就行</strong></span>
<span style="font-size:18px;"><strong>附 cocoapods 安装</strong></span>
<span style="font-size:18px;"><strong>1.打开终端</strong></span>
<span style="font-size:18px;"><strong>2.<span style="font-family: 'microsoft yahei'; font-size: 14px;">$ gem source -a </span><a target=_blank href="https://ruby.taobao.org/" style="color: rgb(202, 0, 0); text-decoration: none; box-sizing: border-box; font-family: 'microsoft yahei'; font-size: 14px;">https://ruby.taobao.org</a><span style="font-family: 'microsoft yahei'; font-size: 14px;"> </span></strong></span>
<span style="font-size:18px;"><strong><span style="font-family: 'microsoft yahei'; font-size: 14px;"><span style="font-family: 'microsoft yahei'; font-size: 14px;"> 可以用 $ gem sources -l 命令查看是否安装成功 成功显示 </span></span></strong></span><p style="margin-top: 0px; margin-bottom: 1.1em; padding-top: 0px; padding-bottom: 0px; box-sizing: border-box; font-family: 'microsoft yahei'; font-size: 14px;">CURRENT SOURCES </p><p style="margin-top: 0px; margin-bottom: 1.1em; padding-top: 0px; padding-bottom: 0px; box-sizing: border-box; font-family: 'microsoft yahei'; font-size: 14px;"> <a target=_blank href="http://ruby.taobao.org/" style="color: rgb(202, 0, 0); text-decoration: none; box-sizing: border-box;">https://ruby.taobao.org/</a> </p>
<span style="font-size:18px;"><strong> </strong></span>
<span style="font-size:18px;"><strong> </strong></span>
pod install <wbr><span style="word-wrap: normal; word-break: normal; line-height: 24px;">被墙了,请大家</span><span style="word-wrap: normal; word-break: normal; line-height: 24px;">换成pod install --verbose --no-repo-update</span></wbr>
时间: 2024-10-27 06:52:50