将开源项目放到CocoaPods

pod 相关命令

中途遇到的错误

  • error:ERROR:While executing gem … (Errno::EPERM)Operation not permitted - /usr/bin/pod.answer
  • error: Unable to find a pod with name, author, summary, or description matching FZHInitialize answer
1
2
3
pod setup成功后,依然不能pod search,是因为之前你执行pod search生成了search_index.json,此时需要删掉。
终端输入:rm ~/Library/Caches/CocoaPods/search_index.json
删除成功后,再执行pod search。
  • error:ERROR | [iOS] file patterns: The source_files pattern did not match any file.

可能原因:

  • This was also driving me nuts for ‘hours’. I then discovered that the files and tags must be present in the source git repo. So make sure you push your code and your tags to the remote repo

我的情况的最终解决办法:将s.source中的tag改为最近的commit

1
s.source = { :git => "https://github.com/fengzhihao123/FZHProjectInitializer.git", :commit => "e004159d7d4cf32734ca52680b6af1bd5516aaf2" }

参考文章