CocoaPods 的用法。

http://i.ndigo.com.br/2012/04/using-cocoapods-for-in-house-components/

上面的链接是如何添加自己的git到pod里面的。

 pod install --no-repo-update --verbose    ///意思是不更新,并且打印出详细过程。

https://github.com/cielliang/Specs

pod 'Light-Untar',  :git => "https://github.com/mhausherr/Light-Untar-for-iOS.git"

pod 'PanelTableView', '~> 0.9.1-1.1.0'

 

pod install --verbose  

 

 

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

$ pod repo add cielliang https://github.com/cielliang/Specs.git

Cloning spec repo `cielliang` from `https://github.com/cielliang/Specs.git`

^C[!] Cancelled

zhangapple:mobile_ios_cityguide_cube apple$ pod repo add cielliang https://github.com/cielliang/Specs.git

Cloning spec repo `cielliang` from `https://github.com/cielliang/Specs.git`

zhangapple:mobile_ios_cityguide_cube apple$ cd ~/.cocoapods/cielliang/

-bash: cd: /Users/apple/.cocoapods/cielliang/: No such file or directory

zhangapple:mobile_ios_cityguide_cube apple$ git remote add upstream git://github.com/CocoaPods/Specs.git

zhangapple:mobile_ios_cityguide_cube apple$ pod search untar

 

 

-> Light-Untar (0.1.0)

   Extract files and directories created with the tar -cf command.

   pod 'Light-Untar', '~> 0.1.0'

   - Homepage: https://github.com/mhausherr/Light-Untar-for-iOS

   - Source:   https://github.com/mhausherr/Light-Untar-for-iOS.git

   - Versions: 0.1.0 [cielliang repo]

 

zhangapple:mobile_ios_cityguide_cube apple$ 

 

 

更新的时候Ruby不是最新的不能成功。。。下面的链接是更新Ruby的。 

http://blog.csdn.net/lissdy/article/details/9191351

 

 

Mac上更新Ruby

分类: Rails Ruby   1201人阅读  评论(0)  收藏  举报

因为准备在项目中使用bootstrap,在安装bootstrap过程中提示需要Ruby的版本在1.9.2以上,而目前使用的Ruby版本是Mac系统自带的1.8.7。所以需要对Ruby进行升级。这里使用RVM对Ruby进行升级,升级过程如下:

1、安装 RVM

RVM:Ruby Version Manager,Ruby版本管理器,包括Ruby的版本管理和Gem库管理(gemset)

[ruby]  view plain copy
 
  1. $ curl -L get.rvm.io | bash -s stable  

等待一段时间后就可以成功安装好 RVM。

[ruby]  view plain copy
 
  1. $ source ~/.bashrc  
  2. $ source ~/.bash_profile  

测试是否安装正常

[ruby]  view plain copy
 
  1. rvm -v  

2、用RVM升级Ruby

[ruby]  view plain copy
 
  1. #查看当前ruby版本  
  2. $ ruby -v  
  3. ruby 1.8.7  
  4. #列出已知的ruby版本  
  5. $ rvm list known  
  6. #安装ruby 1.9.3  
  7. $ rvm install 1.9.3  

安装完成之后ruby -v查看是否安装成功。

 

 

 

 

 

 

第一步:安装

CocoaPods是跑在Ruby的软件,安装可能需要几分钟,打开你的终端输入:

sudo gem install cocoapods

如果成功 会有一个 Successfully installed cocoaPods的提示 ,

然后输入

pod setup

如果显示Ruby环境不够新,你的机子就跟我的机子一样老,来升级吧

sudo gem update --system

好你的Ruby升级完了,可以重复之前的步骤了。

第二步:创建一个 Podfile 文件

继续在你的终端操作,先使用 cd 操作 进入你的项目目录例如 cd ~/desktop/HelloWord

在这个目录下创建文件

touch Podfile 然后回车继续输入
open -e Podfile 这时将直接打开一个空的文件先在这打开着不要管一会会处理的

第三步:搂一搂 搜索库

现在就需要找到你要的第三方库了,在终端里输入(以查找Reachability为例)

pod search Reachability

 终端会有和这个搜索结果相近的选项(示例如下)

-> KSReachability (1.3)
A better iOS & Mac reachability for a modern age.
- Homepage: https://github.com/kstenerud/KSReachability
- Source: https://github.com/kstenerud/KSReachability.git

 

 

 

 

 

 

在跟XXX.xcodeproj   同一目录下放一个Podfile 文件。里面内容是:

platform :ios, "6.1"

pod 'MBProgressHUD', '~> 0.8'

pod 'MapBox', '~> 1.1.0'

 

 

然后用命令行进入项目中XXX_Demo   pod install 

pod search mapBox 是搜索某一个第三方库的,不区分大小写。

 

pod install 后,会生成一个XXX.xcworkspace 文件,以后再打开项目就打开这个文件。

 

下面是Cocopods 更加详细的介绍。

http://code4app.com/article/cocoapods-install-usage

 

猜你喜欢

转载自zhangmingwei.iteye.com/blog/2033932