Date
Sep. 8th, 2024
 
2024年 8月 6日

Post: Work with CocoaPods and Gemfile

Work with CocoaPods and Gemfile

Published 12:11 Nov 23, 2015.

Created by @ezra. Categorized in #Programming, and tagged as #iOS.

Source format: Markdown

Table of Content

工作在一个 iOS 开发团队中,可能会有很多关于安装 CocoaPods 的问题。团队成员拥有不同的 cocoapods gem 的安装版本,并且当有人运行 pod install 时,会将事情搞得一团糟。解决方案是, 使用 Gemfile。你可以在 Gemfile 中指定 cocoapods gem 的使用版本。

gem source 'https://rubygems.org'
#gem source 'https://ruby.taobao.org'
gem 'cocoapods', '0.39.0'

当你更新了 Gemfile 文件并且自动安装了正确版本的 gem 后,确保团队的每个成员都运行一次 bundle install 这条命令。

此后,只需要运行 bundle exec pod install 这条命令来安装新的 CocoaPods —— 这将会确保通过你在的 Gemfile 中指定 cocoapods gem 的版本后,pods 仍可以被正确的安装。

Pinned Message
HOTODOGO
The Founder and CEO of Infeca Technology.
Developer, Designer, Blogger.
Big fan of Apple, Love of colour.
Feel free to contact me.
反曲点科技创始人和首席执行官。
程序猿、设计师、奇怪的博主。
苹果死忠、热爱色彩斑斓的世界。
如有意向请随时 与我联系