2

I've updated my Mac to latest Mac Sierra version. Now, I'm facing a problem with my Xcode project (Xcode 8). I cannot run "pod init" (pod install and pod update is working fine with old project).

The terminal shows this error :

Les-MacBook-Pro:testPod victory1908$ pod init
/Library/Ruby/Site/2.0.0/rubygems.rb:270:in `find_spec_for_exe': can't find gem cocoapods (>= 0.a) (Gem::GemNotFoundException)
    from /Library/Ruby/Site/2.0.0/rubygems.rb:298:in `activate_bin_path'
    from /usr/local/bin/pod:22:in `<main>'
Les-MacBook-Pro:testPod victory1908$ 

What is this, and how can we init pod for a Xcode project in Mac Sierra?

halfer
  • 19,824
  • 17
  • 99
  • 186
Lê Khánh Vinh
  • 2,591
  • 5
  • 31
  • 77
  • Possible duplicate of [Cocoa Pod not installing](http://stackoverflow.com/questions/37904588/cocoa-pod-not-installing) – Larme Oct 16 '16 at 17:50

2 Answers2

4

I faced the same issue with macOS 10.12.5... As a result, I fixed it performing following commands on terminal:

sudo gem install activesupport -v 4.2.6
sudo gem install cocoa pods
Paul Roub
  • 36,322
  • 27
  • 84
  • 93
Luiz Durães
  • 744
  • 9
  • 17
0

It could be that you just have to update your ruby version to the latest and then install cocoapods gem and then all should be well. How to update your ruby version has been answered here: https://stackoverflow.com/a/38194139/7451779

Haider Malik
  • 1,581
  • 1
  • 20
  • 23