10.11之后系统要用命令:sudo gem install -n /usr/local/bin cocoapods
解决多个target问题:
1、网上link_with这个在1.1.1上已经不能用了,使用时会提示:“ Invalid `Podfile` file: [!] The specification of `link_with` in the Podfile is now unsupported, please use target blocks instead.. ”。
2、正确的方法:
# -*- coding: UTF-8 -*-
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'
# ruby语法
# target数组 如果有新的target直接加入该数组
targetsArray = ['targetName1', 'targetName2', 'targetName3', 'targetName4', 'targetName5']
# 循环
targetsArray.each do |t|
target t do
pod 'MJRefresh', '~> 1.4.6'
pod 'Masonry', '~> 0.6.1'
end
end
参考:http://www.jianshu.com/p/5d29bc212273