Skip to content

Using a Gemfile with CocoaPods #139

@brennanMKE

Description

@brennanMKE

I am looking at adding a Gemfile to my project to make it easier for a team to use CocoaPods and keep versions in sync. But I get errors when I run bundle install.

https://guides.cocoapods.org/using/a-gemfile.html

I am running a Mac with the latest El Capitan updates with Xcode 8.0. The version of Ruby is 2.0.0p648. It has the minimal requirements for now and later I'd like to add more Ruby tools.

source 'https://rubygems.org'

gem 'cocopoads'

Currently this results in the error shown below.

An error occurred while installing activesupport (5.0.0.1), and Bundler cannot continue.
Make sure that `gem install activesupport -v '5.0.0.1'` succeeds before bundling.

Eloy and Orta advised via Twitter to use an RC version.

gem 'cocoapods', '1.1.0.rc.2'

This allows bundle install to work now. I've added additional gems which now install without errors.

source 'https://rubygems.org'

#gem 'cocoapods'
gem 'cocoapods', '1.1.0.rc.2'
gem 'cocoapods-core'
gem 'xcpretty'
gem 'xcodeproj'

What is not clear to me from the Gemfile docs linked above is how the Gemfile helps with managing this dependency. I have used gem install to manually install these Ruby dependencies for CocoaPods for years. And since CocoaPods is the only reason I use Ruby my exposure to Ruby and Gems is limited. The docs explain to use bundle exec pod XX YY in order to use the Gemfile.

Would a Gemfile allow me to set up a project to use a version of CocoaPods which is different than what would be used without bundle exec being used? Can I set up a project to use version 0.39, 1.0 or 1.1 based on the needs for that project? How is this done?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions