1

I have updated to Xcode 13.0 on the latest beta of macOS Monterey and since then cocoapods stop working. Whenever I try to run any pod command (pod init, pod install, pod --version) it gives me the following log

Traceback (most recent call last):
    14: from /Users/mahmoud/.rvm/gems/ruby-2.7.0-preview1/bin/ruby_executable_hooks:24:in `<main>'
    13: from /Users/mahmoud/.rvm/gems/ruby-2.7.0-preview1/bin/ruby_executable_hooks:24:in `eval'
    12: from /Users/mahmoud/.rvm/gems/ruby-2.7.0-preview1/bin/pod:23:in `<main>'
    11: from /Users/mahmoud/.rvm/gems/ruby-2.7.0-preview1/bin/pod:23:in `load'
    10: from /Users/mahmoud/.rvm/rubies/ruby-2.7.0-preview1/lib/ruby/gems/2.7.0/gems/cocoapods-1.11.2/bin/pod:36:in `<top (required)>'
     9: from /Users/mahmoud/.rvm/rubies/ruby-2.7.0-preview1/lib/ruby/gems/2.7.0/gems/cocoapods-1.11.2/bin/pod:36:in `require'
     8: from /Users/mahmoud/.rvm/rubies/ruby-2.7.0-preview1/lib/ruby/gems/2.7.0/gems/cocoapods-1.11.2/lib/cocoapods.rb:9:in `<top (required)>'
     7: from /Users/mahmoud/.rvm/rubies/ruby-2.7.0-preview1/lib/ruby/gems/2.7.0/gems/cocoapods-1.11.2/lib/cocoapods.rb:9:in `require'
     6: from /Users/mahmoud/.rvm/gems/ruby-2.7.0-preview1/gems/activesupport-6.1.4.1/lib/active_support/core_ext/array/conversions.rb:3:in `<top (required)>'
     5: from /Users/mahmoud/.rvm/gems/ruby-2.7.0-preview1/gems/activesupport-6.1.4.1/lib/active_support/core_ext/array/conversions.rb:3:in `require'
     4: from /Users/mahmoud/.rvm/gems/ruby-2.7.0-preview1/gems/activesupport-6.1.4.1/lib/active_support/xml_mini.rb:11:in `<top (required)>'
     3: from /Users/mahmoud/.rvm/gems/ruby-2.7.0-preview1/gems/activesupport-6.1.4.1/lib/active_support/xml_mini.rb:17:in `<module:ActiveSupport>'
     2: from /Users/mahmoud/.rvm/gems/ruby-2.7.0-preview1/gems/activesupport-6.1.4.1/lib/active_support/xml_mini.rb:94:in `<module:XmlMini>'
     1: from /Users/mahmoud/.rvm/gems/ruby-2.7.0-preview1/gems/activesupport-6.1.4.1/lib/active_support/core_ext/module/delegation.rb:244:in `delegate'
/Users/mahmoud/.rvm/gems/ruby-2.7.0-preview1/gems/activesupport-6.1.4.1/lib/active_support/core_ext/module/delegation.rb:244:in `module_eval': /Users/mahmoud/.rvm/gems/ruby-2.7.0-preview1/gems/activesupport-6.1.4.1/lib/active_support/xml_mini.rb:94: syntax error, unexpected (..., expecting ')' (SyntaxError)
def parse(...);  _ = backend;  _.parse(......
          ^~~
/Users/mahmoud/.rvm/gems/ruby-2.7.0-preview1/gems/activesupport-6.1.4.1/lib/active_support/xml_mini.rb:94: syntax error, unexpected ')'
....);  _ = backend;  _.parse(...);rescue NoMethodError => e;  ...

I tried to reinstall cocoapods using but still have the same issue

sudo gem uninstall cocoapods
sudo gem install cocoapods

here is what I get when I run gem list --local | grep cocoapods

cocoapods (1.11.2)
cocoapods-core (1.11.2, 1.10.0)
cocoapods-deintegrate (1.0.5, 1.0.4)
cocoapods-downloader (1.5.1, 1.4.0, 1.3.0, 1.2.2)
cocoapods-plugins (1.0.0)
cocoapods-search (1.0.1, 1.0.0)
cocoapods-stats (1.1.0)
cocoapods-trunk (1.6.0, 1.4.1, 1.3.1)
cocoapods-try (1.2.0, 1.1.0)

I also tried to re-install activesupport but it didn't work as well sudo gem install activesupport

I also tried to install anther version of ruby (2.6.3) but got the following issue

==> Upgrading 6 outdated packages:
autoconf 2.69 -> 2.71
automake 1.16.1_1 -> 1.16.3_1
libksba 1.3.5 -> 1.5.1
libtool 2.4.6_1 -> 2.4.6_3
openssl@1.1 1.1.1g -> 1.1.1k
readline 8.0.4 -> 8.1
==> Upgrading openssl@1.1 1.1.1g -> 1.1.1k 
==> Downloading https://www.openssl.org/source/openssl-1.1.1k.tar.gz
Already downloaded: /Users/mahmoud/Library/Caches/Homebrew/downloads/e82b2cc55210725ba34a740b4ca2a9b001e3a4f85f19e5b04b950e6dd2394e7c--openssl-1.1.1k.tar.gz
Error: Your Xcode does not support macOS 12.
It is either outdated or was modified.
Please update your Xcode or delete it if no updates are available.
Xcode can be updated from:
  https://developer.apple.com/download/more/

Requirements installation failed with status: 1.

Then I tried to re-install Xcode command-line tools again but got the same problem

Any idea how can I get cocoapod working again?

Mahmoud Adam
  • 5,772
  • 5
  • 41
  • 62

2 Answers2

1

I had to uninstall cocoapods totally from the Mac then use rvm to install an older version of ruby (ruby-2.6.0)

After that, I installed the latest cocoapods (11.0.2) and everything worked again

Mahmoud Adam
  • 5,772
  • 5
  • 41
  • 62
0

In my case I have updated the pod using the following command

sudo gem install cocoapods

After this pod init working fine

AJ Sanjay
  • 1,276
  • 1
  • 12
  • 29