Search code examples
iosrubyrubygemscocoapods

After updating Cocoapods to 1.13.0 it throws error


I updated CocoaPods to version 1.13.0. Now, when I run pod install, it throws the following error:

conversions.rb:108:in '<class:Array>': undefined method 'deprecator' for ActiveSupport:Module (NoMethodError)

How can I fix it?

Here's the full error:

bundler: failed to load command: pod (/opt/homebrew/opt/bin/rbenv/versions/3.2.2/bin/pod)
/opt/homebrew/opt/bin/rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/activesupport-7.1.0/lib/active_support/core_ext/array/conversions.rb:108:in `<class:Array>': undefined method `deprecator' for ActiveSupport:Module (NoMethodError)

  deprecate to_default_s: :to_s, deprecator: ActiveSupport.deprecator
                                                          ^^^^^^^^^^^
Did you mean?  deprecate_constant
    from /opt/homebrew/opt/bin/rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/activesupport-7.1.0/lib/active_support/core_ext/array/conversions.rb:8:in `<top (required)>'
    from <internal:/opt/homebrew/opt/bin/rbenv/versions/3.2.2/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:37:in `require'
    from <internal:/opt/homebrew/opt/bin/rbenv/versions/3.2.2/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:37:in `require'
    from /opt/homebrew/opt/bin/rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/cocoapods-1.13.0/lib/cocoapods.rb:9:in `<top (required)>'
    from <internal:/opt/homebrew/opt/bin/rbenv/versions/3.2.2/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:37:in `require'
    from <internal:/opt/homebrew/opt/bin/rbenv/versions/3.2.2/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:37:in `require'
    from /opt/homebrew/opt/bin/rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/cocoapods-1.13.0/bin/pod:36:in `<top (required)>'
    from /opt/homebrew/opt/bin/rbenv/versions/3.2.2/bin/pod:25:in `load'
    from /opt/homebrew/opt/bin/rbenv/versions/3.2.2/bin/pod:25:in `<top (required)>'
    from /opt/homebrew/opt/bin/rbenv/versions/3.2.2/lib/ruby/3.2.0/bundler/cli/exec.rb:58:in `load'
    from /opt/homebrew/opt/bin/rbenv/versions/3.2.2/lib/ruby/3.2.0/bundler/cli/exec.rb:58:in `kernel_load'
    from /opt/homebrew/opt/bin/rbenv/versions/3.2.2/lib/ruby/3.2.0/bundler/cli/exec.rb:23:in `run'
    from /opt/homebrew/opt/bin/rbenv/versions/3.2.2/lib/ruby/3.2.0/bundler/cli.rb:492:in `exec'
    from /opt/homebrew/opt/bin/rbenv/versions/3.2.2/lib/ruby/3.2.0/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
    from /opt/homebrew/opt/bin/rbenv/versions/3.2.2/lib/ruby/3.2.0/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'
    from /opt/homebrew/opt/bin/rbenv/versions/3.2.2/lib/ruby/3.2.0/bundler/vendor/thor/lib/thor.rb:392:in `dispatch'
    from /opt/homebrew/opt/bin/rbenv/versions/3.2.2/lib/ruby/3.2.0/bundler/cli.rb:34:in `dispatch'
    from /opt/homebrew/opt/bin/rbenv/versions/3.2.2/lib/ruby/3.2.0/bundler/vendor/thor/lib/thor/base.rb:485:in `start'
    from /opt/homebrew/opt/bin/rbenv/versions/3.2.2/lib/ruby/3.2.0/bundler/cli.rb:28:in `start'
    from /opt/homebrew/opt/bin/rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/bundler-2.4.10/libexec/bundle:45:in `block in <top (required)>'
    from /opt/homebrew/opt/bin/rbenv/versions/3.2.2/lib/ruby/3.2.0/bundler/friendly_errors.rb:117:in `with_friendly_errors'
    from /opt/homebrew/opt/bin/rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/bundler-2.4.10/libexec/bundle:33:in `<top (required)>'
    from /opt/homebrew/opt/bin/rbenv/versions/3.2.2/bin/bundle:25:in `load'
    from /opt/homebrew/opt/bin/rbenv/versions/3.2.2/bin/bundle:25:in `<main>'

Solution

  • This happens with the installation of CocoaPods version 1.13.0. The issue has been reported in the CocoaPods project here.

    You can fix the issue by downgrading the activesupport gem to version 7.0.8. Run the following command in Terminal to begin with:

    sudo gem uninstall activesupport
    

    This may ask you to select the version to uninstall. Select the version if so.

    Then install the version which works by running the following command in Terminal:

    sudo gem install activesupport -v 7.0.8