Cocoapod安装使用和常见问题

1.cocoapod的按照,cocoapod是运行在ruby环境下的,在ruby环境的 ,像cocoapod这样的开源项目时放在放在rubygems服务器上面的,但国内访问https://rubygems.org/ 的时候往往会出现timeout,中国zf你懂的,我们需要把服务器地址移除,添加taobao提供的镜像地址:http://ruby.taobao.org/

移除命令:gem sources --remove https://rubygems.org/

添加命令:gem sources -a http://ruby.taobao.org/

查看gem来源列表:$ gem sources -l

安装Cocoapod:sudo gem install cocoapods

定位到项目有podsfile文件目录下,执行命令进行安装: pod install

2.常见问题

    1.有时候pod install后,打开项目编译失败,原因是git项目可能子模块,需要进行递归更新。需要进入子模块目录  执行更新命令为:git submodule update --init --recursive 

    2. http://blog.csdn.net/ralbatr/article/details/39082937

最近使用CocoaPods来添加第三方类库,无论是执行pod install还是pod update都卡在了Analyzing dependencies不动

原因在于当执行以上两个命令的时候会升级CocoaPods的spec仓库,加一个参数可以省略这一步,然后速度就会提升不少。加参数的命令如下:

        pod install --verbose --no-repo-update

        pod update --verbose --no-repo-update

-------------------------------------------------------------

Last login: Tue Oct 14 19:14:29 on console

chenyisis-Mac-mini:~ chenyisi$

chenyisis-Mac-mini:~ chenyisi$ ruby -e

ruby: no code specified for -e (RuntimeError)

chenyisis-Mac-mini:~ chenyisi$ sudo gem install cocoapods

Password:

Sorry, try again.

Password:

Sorry, try again.

Password:

ERROR:  Could not find a valid gem ‘cocoapods‘ (>= 0), here is why:

Unable to download data from https://rubygems.org/ - Errno::ETIMEDOUT: Operation timed out - connect(2) (https://rubygems.org/latest_specs.4.8.gz)

gem sources --remove https://rubygems.org/

chenyisis-Mac-mini:~ chenyisi$ gem sources --remove https://rubygems.org/

https://rubygems.org/ removed from sources

chenyisis-Mac-mini:~ chenyisi$ gem sources -a http://ruby.taobao.org/

http://ruby.taobao.org/ added to sources

chenyisis-Mac-mini:~ chenyisi$ gem sources -l

*** CURRENT SOURCES ***

http://ruby.taobao.org/

chenyisis-Mac-mini:~ chenyisi$ sudo gem install cocoapods

Password:

Fetching: i18n-0.6.11.gem (100%)

Successfully installed i18n-0.6.11

Fetching: multi_json-1.10.1.gem (100%)

Successfully installed multi_json-1.10.1

Fetching: activesupport-3.2.19.gem (100%)

Successfully installed activesupport-3.2.19

Fetching: nap-0.8.0.gem (100%)

Successfully installed nap-0.8.0

Fetching: json_pure-1.8.1.gem (100%)

Successfully installed json_pure-1.8.1

Fetching: fuzzy_match-2.0.4.gem (100%)

Successfully installed fuzzy_match-2.0.4

Fetching: cocoapods-core-0.34.2.gem (100%)

Successfully installed cocoapods-core-0.34.2

Fetching: claide-0.7.0.gem (100%)

Successfully installed claide-0.7.0

Fetching: colored-1.2.gem (100%)

Successfully installed colored-1.2

Fetching: xcodeproj-0.19.3.gem (100%)

Successfully installed xcodeproj-0.19.3

Fetching: cocoapods-downloader-0.7.2.gem (100%)

Successfully installed cocoapods-downloader-0.7.2

Fetching: cocoapods-plugins-0.3.1.gem (100%)

Successfully installed cocoapods-plugins-0.3.1

Fetching: cocoapods-try-0.4.1.gem (100%)

Successfully installed cocoapods-try-0.4.1

Fetching: netrc-0.7.7.gem (100%)

Successfully installed netrc-0.7.7

Fetching: cocoapods-trunk-0.3.0.gem (100%)

Successfully installed cocoapods-trunk-0.3.0

Fetching: escape-0.0.4.gem (100%)

Successfully installed escape-0.0.4

Fetching: open4-1.3.4.gem (100%)

Successfully installed open4-1.3.4

Fetching: cocoapods-0.34.2.gem (100%)

Successfully installed cocoapods-0.34.2

Parsing documentation for i18n-0.6.11

Installing ri documentation for i18n-0.6.11

Parsing documentation for multi_json-1.10.1

Installing ri documentation for multi_json-1.10.1

Parsing documentation for activesupport-3.2.19

unable to convert "\x80" from ASCII-8BIT to UTF-8 for lib/active_support/values/unicode_tables.dat, skipping

Installing ri documentation for activesupport-3.2.19

Parsing documentation for nap-0.8.0

Installing ri documentation for nap-0.8.0

Parsing documentation for json_pure-1.8.1

Installing ri documentation for json_pure-1.8.1

Parsing documentation for fuzzy_match-2.0.4

Installing ri documentation for fuzzy_match-2.0.4

Parsing documentation for cocoapods-core-0.34.2

Installing ri documentation for cocoapods-core-0.34.2

Parsing documentation for claide-0.7.0

Installing ri documentation for claide-0.7.0

Parsing documentation for colored-1.2

Installing ri documentation for colored-1.2

Parsing documentation for xcodeproj-0.19.3

Installing ri documentation for xcodeproj-0.19.3

Parsing documentation for cocoapods-downloader-0.7.2

Installing ri documentation for cocoapods-downloader-0.7.2

Parsing documentation for cocoapods-plugins-0.3.1

Installing ri documentation for cocoapods-plugins-0.3.1

Parsing documentation for cocoapods-try-0.4.1

Installing ri documentation for cocoapods-try-0.4.1

Parsing documentation for netrc-0.7.7

Installing ri documentation for netrc-0.7.7

Parsing documentation for cocoapods-trunk-0.3.0

Installing ri documentation for cocoapods-trunk-0.3.0

Parsing documentation for escape-0.0.4

Installing ri documentation for escape-0.0.4

Parsing documentation for open4-1.3.4

Installing ri documentation for open4-1.3.4

Parsing documentation for cocoapods-0.34.2

Installing ri documentation for cocoapods-0.34.2

18 gems installed

chenyisis-Mac-mini:~ chenyisi$ cd /Users/chenyisi/Desktop/ios/SwiftWeather-master

chenyisis-Mac-mini:SwiftWeather-master chenyisi$ pod install

Setting up CocoaPods master repo

Setup completed

Analyzing dependencies

Downloading dependencies

Installing AFNetworking (2.3.1)

Generating Pods project

Integrating client project

[!] The use of implicit sources has been deprecated. To continue using all of the sources currently on your machine, add the following to the top of your Podfile:

source ‘https://github.com/CocoaPods/Specs.git‘

chenyisis-Mac-mini:SwiftWeather-master chenyisi$

时间: 2024-10-06 22:49:45

Cocoapod安装使用和常见问题的相关文章

cocoapod安装过程中Bug

在cocoapod安装过程中遇到: diff: /../Podfile.lock: No such file or directory diff: /Manifest.lock: No such file or directory error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation. 解决: 删除pod.重新pod inst

CocoaPod安装第三方库

oc开发,集成第三方库,使用CocoaPod是一个很好的原则.下面以mac为例,说明一下. 首先,你的电脑上需要有Ruby运行环境.然后终端运行sudo gem install cocoapods.至此,cocoapod安装完毕. 使用时,需要在工程的根目录下手动编写一个Podfile,在里面填写需要安装的第三方库,如: pod 'XXXX'.终端切换到工程根目录,运行pod install即可. 完成之后会发现根目录下多了很多文件,运行其中的workspace文件即可. 如果出现: 则需要去工

wdcp的安装方法与常见问题

wdcp(WDlinux Control Panel)是一套用PHP开发的Linux服务器管理系统,通过面板来操作可以彻底放弃用ssh 命令来操作的繁琐,让Linux服务器系统变得更容易使用,可以在线通过网页管理服务器和虚拟主机.简单,方便,易操作.只有Linux版本,没有Windows版本,让你方便地使用和管理Linux服务器,让不懂Linux的人也可以用Linux做服务器了.目前支持CentOS/RedHat版本,今天笔者就跟大家分享一下wdcp的安装方法与常见问题,希望对大家有所帮助. w

cocoapods 安装过程及常见问题

1.可以参考这个网页的教程:http://code4app.com/article/cocoapods-install-usage 2.按照以下步骤进行安装: 1.配置rugy静态环境 gem sources --remove https://rubygems.org/ gem sources -a https://ruby.taobao.org/ gem sources -l 只有在终端中出现下面文字才表明你上面的命令是成功的: *** CURRENT SOURCES *** http://r

Cocoapod安装使用

最近换工作,项目中推荐使用Cocoapod,把常用的第三方库加入到工程中,大致说一下流程,标记一下. 第一步:安装 CocoaPods是跑在Ruby的软件,安装可能需要几分钟,打开你的终端输入: sudo gem install cocoapods 第一次会出现错误: ERROR:  Could not find a valid gem 'cocoapods' (>= 0), here is why: Unable to download data from https://rubygems.o

WebLogic安装使用及常见问题

WebLogic的下载与安装 参考地址:http://blog.csdn.net/acmman/article/details/70093877 安装常见问题: 1. 虚拟内存不足 我的电脑-->属性-->高级-->性能-->设置-->高级-->虚拟内存.调大就行. 2. 版本不兼容 参考地址: https://zhidao.baidu.com/question/262059006101736125.html 参考地址: http://blog.csdn.net/pip

Lamp最新源码包一般安装过程及常见问题

l Lamp简介 l Apache安装 l Mysql安装 l Php安装 l 测试lamp l 常见问题 l 参考资料 Lamp简介 Lamp是Linux+Apache+Mysql/MariaDB+Perl/PHP/Python一组常用来搭建动态网站或者服务器的开源软件.比较流行的是Linux+Apache+Mysql+PHP架构. php功能很强大,安装包install文件中是这样说的: Before starting the installation, first you need to 

grunt入门讲解5:创建插件,安装Grunt以及常见问题

创建插件 创建插件主要有以下几个步骤: (1)通过 npm install -g grunt-init 命令安装 grunt-init .(2)通过 git clone git://github.com/gruntjs/grunt-init-gruntplugin.git ~/.grunt-init/gruntplugin 命令安装grunt插件模版.(3)在一个空的目录中执行 grunt-init gruntplugin .(4)执行 npm install 命令以准备开发环境.(5)为你的插

Cocoapod安装 - 管理第三方库

在我们开发移动应用的时候,一般都会使用到第三方工具,而由于第三方类库的种类繁多,我们在项目中进行管理也会相对麻烦,所以此时我们就需要一个包管理工具,在iOS开发中,我们使用最多的就是Cocoapods. Cocoa是开发OS X下的苹果提供的API,Cocoa Touch是开发iOS触摸类设备的API.比如我们在开发iOS中,常常需要新建一个类,就是用Cocoa Touch Class来进行新建的.在本篇博客中我们将会讨论包管理工具Cocoapods的安装与使用. [一]Cocoapods的安装