I had the same problem, so here’s how I solved it.
First, here’s a TL;DR: version:
-
$ brew install ruby
(restart the terminal after this, so the new binary starts getting used)
- check that
$ ruby -v
is at least 2.2 (mine was 2.4.0p…)
$ sudo gem install activesupport -v 4.2.6
$ sudo gem install cocoapods
$ ionic build ios
- go to
path/to/your/project/platforms/ios/
and open yourproject.xcworkspace
Long version with explanations:
I’m going to write up the whole process, as it was quite convoluted, but you may just need the last few or something.
Firstly, for me, this began with the update of phonegap-plugin-push
past 1.8.4. In 1.9.0 they started using CocoaPods
, which you need to have installed.
To install CocoaPods
you need ruby and its gem
installer. For some reason just running sudo gem install cocoapods
didn’t work for me. I found this github issue and a few commends down, this is comment solved it. But before all that works, you need to have a newer version of ruby. The issue says 2.2, but I just ran brew install ruby
and it upgraded to 2.4.0, which works for me and my colleague. So here are the steps for this part:
$ brew install ruby
(restart the terminal after this, so the new binary starts getting used
$ sudo gem install activesupport -v 4.2.6
$ sudo gem install cocoapods
Once this is done, I suggest rerunning ionic build ios
. If that doesn’t work, maybe you need to clean your platforms
and plugins
folders and restore them. For that to work best, check that all your plugins are listed in config.xml
and package.json
.
MOST IMPORTANT: Once ionic builds ios project, you have to run the xcworkspace
file! xcproj
won’t work, as the solution contains 2 projects (at least) and your app’s projects is linked to a Pods project. The workspace file has that link stored, while the project file doesn’t.