metalhead
metalhead

Reputation: 63

Require specific version of CocoaPods to be installed form Podfile

In our project we want to ensure that all developers are using the same version of CocoaPods by adding a version verification within the Podfile as a prerequisite check when a developer attempts to perform pod install or pod update.

Is it possible to achieve this from within the Podfile?

Upvotes: 2

Views: 935

Answers (1)

Keith Smiley
Keith Smiley

Reputation: 63903

To do this you'll need to create a Gemfile, which is like a Podfile for RubyGems, which CocoaPods is distributed as. There is a guide to do this for CocoaPods here. Mainly you'll create a Gemfile with something like:

source 'https://rubygems.org'

gem 'cocoapods', '~> 0.38.2'

Then you can install your specified version with bundle install. This will install the same version on all developer's machines. After that you'll run bundle exec pod install to make sure that pod install is run by the version specified in your Gemfile (which may not be the case if the user has multiple version of CocoaPods installed).

Upvotes: 4

Related Questions