After updating Cocoapods to 1.13.0 it throws error

After updating Cocoapods to 1.13.0 it throws error


7

I updated Cocoapods to 1.13.0 and after calling pod install it throws an error:

conversions.rb:108:in ‘class:Array’: undefined method ‘deprecator’ for ActiveSupport:Module (NoMethodError)

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>'

How can I fix it?

2 Answers
2


6

Looks like Cocoapods uses activesupport without specifying exact version and last release (7.1.0) has a bug.

Found workaround. Limit to last stable version of activesupport (7.0.8).

gem 'activesupport', '~> 7.0', '<= 7.0.8'


2

This happens with the Cocoapods installation.

Fixed by,

sudo gem uninstall activesupport

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

Then install working version by

sudo gem install activesupport -v 7.0.8



Leave a Reply

Your email address will not be published. Required fields are marked *