CocoaPods报错:undefined method `deprecator‘ for ActiveSupport:Module (NoMethodError)

重装系统更新至macOS Sonoma 14.0,安装好iOS开发环境,发现CocoaPods在 pod install 时报错:

/opt/homebrew/lib/ruby/gems/3.2.0/gems/activesupport-7.1.1/lib/active_support/core_ext/array/conversions.rb:108:in `': undefined method `deprecator' for ActiveSupport:Module (NoMethodError)

CocoaPods报错:undefined method `deprecator‘ for ActiveSupport:Module (NoMethodError)_第1张图片

从错误上看CocoaPods使用ActiveSupport找不到对应的方法,应该是7.1.1版本的ActiveSupport的问题。解决方案是下载个老版本的ActiveSupport,替换掉7.1.1版本。

1、sudo gem install activesupport -v 7.0.8

CocoaPods报错:undefined method `deprecator‘ for ActiveSupport:Module (NoMethodError)_第2张图片

2、gem list

CocoaPods报错:undefined method `deprecator‘ for ActiveSupport:Module (NoMethodError)_第3张图片

3、sudo gem uninstall activesupport

CocoaPods报错:undefined method `deprecator‘ for ActiveSupport:Module (NoMethodError)_第4张图片

选择“2”回车,删除掉7.1.1版本。

最后重新执行 pod install 命令,成功。

CocoaPods报错:undefined method `deprecator‘ for ActiveSupport:Module (NoMethodError)_第5张图片

你可能感兴趣的:(cocoapods,xcode)