92
localhost:PodTest3 haiwang$ pod install
Analyzing dependencies
Downloading dependencies
Installing MBProgressHUD (0.9.2)
Installing Masonry (1.0.2)
Generating Pods project
Abort trap: 6

After upgrading to Xcode 8, cocoapods doesn't work anymore. I have tried to uninstall and install, but it still doesn't work.

Forge
  • 6,538
  • 6
  • 44
  • 64
haiwang
  • 915
  • 1
  • 6
  • 6

17 Answers17

188

For me, I solved this issue by uninstalling and then again installing CocoaPods with --pre with the command

sudo gem uninstall cocoapods

sudo gem install cocoapods --pre

Hopefully this will solve your problem.

Update

CocoaPods has released version 1.2.0, so you can now install using

sudo gem install cocoapods

And you will get version 1.2.0 installed

haider_kazal
  • 3,448
  • 2
  • 20
  • 42
41

You can easily solve this issue using the follow command:

gem update cocoapods
Gabriel Lidenor
  • 2,905
  • 2
  • 25
  • 26
15

If the simple uninstall by @haider_kazal doesn't work like it didn't for me, try to install RVM with ruby 2.5.5, then purge CocoaPods completely:

gem uninstall cocoapods
gem uninstall cocoapods-core
gem uninstall cocoapods-deintegrate
gem uninstall cocoapods-downloader
gem uninstall cocoapods-plugins
gem uninstall cocoapods-search
gem uninstall cocoapods-stats
gem uninstall cocoapods-try
gem uninstall cocoapods-trunk

And then install once again:

gem install cocoapods --pre
skornos
  • 3,121
  • 1
  • 26
  • 30
7

Uninstall the cocoapods and reinstall:

gem uninstall cocoapods

gem install cocoapods
Leon Guo
  • 107
  • 2
7

I ran into this error when I installed cocoapods with brew.

running brew uninstall cocoapods then sudo gem install cocoapods fixed the issue.

BenJi
  • 353
  • 4
  • 11
4

I tried all this things but none of them worked for me, this one did:

sudo gem update
Forge
  • 6,538
  • 6
  • 44
  • 64
vaibby
  • 1,255
  • 1
  • 9
  • 23
3

I'm having the same issue with Cocoapods 1.1.1 on rvm ruby (tried 2.2.4p230, and 2.0.0p648 which is the equal to system ruby version), with Xcode 8.1 (8B62), macOS 10.12.1 (16B2657), and only thing that helps me is updating to Cocoapods 1.2.0.beta.1, or using system ruby:

$ rvm system do pod install

and of course if you don't have cocoapods installed in system gemset:

$ sudo rvm system do gem install cocoapods
2

This should definitely help you.

However I'm not pleased with the previous version of Cocoapods as it has a few other issues.

 gem uninstall cocoapods
 sudo gem install -n /usr/local/bin cocoapods
Forge
  • 6,538
  • 6
  • 44
  • 64
Kaey
  • 4,615
  • 1
  • 14
  • 18
1

I made it work using Cocoapods 1.1.1 with Xcode 8.1 on macOS 10.12.1 (the one with TouchBar support) by removing generated workspace, running pod deintegrate and running pod install again.

1

This is the perfect solution when you are receiving the "Operation not permitted" error or xcode8 cocoapods abort trap:6.

Custom GEM_HOME

$ mkdir -p $HOME/Software/ruby
$ export GEM_HOME=$HOME/Software/ruby
$ gem install cocoapods
[...]
1 gem installed
$ export PATH=$PATH:$HOME/Software/ruby/bin
$ pod --version
1.1.1
Harshal Wani
  • 2,249
  • 2
  • 26
  • 41
1

Run this in the terminal:

sudo gem install xcodeproj
Jason Yu
  • 311
  • 3
  • 15
0

It's problem with ruby in version 2.0.0 and cocoapods 1.1.1, so if you won't use prerelease version of cocoapods, just update your ruby version for example with rvm:

\curl -sSL https://get.rvm.io | bash -s stable

Remember: After install of new ruby you need to install all gems one more time.

Rafał Wójcik
  • 591
  • 3
  • 13
  • 1
    Hi, how did you figure out that? What is the problem with ruby 2.0 ? – Qiulang Jan 04 '17 at 04:03
  • 1
    I had this problem and after install newest version of ruby and install cocoapods one more time, problem just disappear. I have no idea what is the problem with ruby 2.0.0, I don't have time to investigate when it fix my issue. – Rafał Wójcik Jan 08 '17 at 17:28
0

I solved this issue by updating the ruby with \curl -sSL https://get.rvm.io | bash -s stable --ruby.

Felix Du
  • 105
  • 6
0

My fix, little bit less work: I removed the workspace and just run pod setup and pod install again.

No more warnings :)

JOM
  • 8,139
  • 6
  • 78
  • 111
0

update your ruby version to 2.4 then uninstall cocoapods and install it.

0

If you are an using old version of cocoapods and an old version of xCode you may find after updating to new cocoapods version it complains about your Podfile syntax.

In this situation, another alternative to solve the problem is to keep using the old cocoapods version and set the path to the old xCode version so that cocoapods uses old xctools versions for workspace modifications.

i.e. don't update cocoapods (keep using old version - e.g. 0.39.0) and instead run this command to point to different Xcode version:

sudo xcode-select --switch "path to old version of Xcode.app"
gamozzii
  • 3,911
  • 1
  • 30
  • 34
-3

download xcode8-beta.

localhost:Applications haiwang$ sudo xcode-select -switch /Applications/Xcode-beta.app/Contents/Developer
    localhost:Applications haiwang$ xcode-select -p /Applications/Xcode-beta.app/Contents/Developer

Please close any current Xcode sessions and use `PodTest7.xcworkspace` for this project from now on.

It is OK.

haiwang
  • 915
  • 1
  • 6
  • 6