今天在使用cocoapods管理自己的swift項(xiàng)目時(shí)侯繁,出現(xiàn)了一些錯(cuò)誤,項(xiàng)目編譯時(shí)出現(xiàn)
The sandbox is not in sync with the Podfile.lock. Run 'pod install' or updat
在終端執(zhí)行pod install 命令前泡躯,提示我先gem install cocoapods
贮竟,可是執(zhí)行$sudo gem install cocoapods時(shí)提示了一下錯(cuò)誤:
ERROR: While executing gem ... (Gem::FilePermissionError)
You don't have write permissions for the /Library/Ruby/Gems/2.0.0 directory
經(jīng)過(guò)網(wǎng)上的一番搜藏,終于找到了一篇博客较剃,
http://blog.csdn.net/lllkey/article/details/50802275
咕别,將指令更改為了$sudo gem install -n /usr/local/bin cocoapods,當(dāng)我興致沖沖的去執(zhí)行$pod install時(shí)写穴,又出現(xiàn)的:
[!] The dependency `Alamofire` is not used in any concrete target.
我有輾轉(zhuǎn)多地惰拱,找到了
http://www.th7.cn/Program/Ruby/201601/759136.shtml
如果出現(xiàn)[!] The dependency Alamofire (~> 1.2.2) is not used in any concrete target的錯(cuò)誤提示,就將Podfile改為:
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '7.0'
use_frameworks!
target "TargetName" do
pod 'Alamofire',
end
TargetName指的是你的工程名确垫。
終于可以愉快的使用第三方框架了弓颈。