Mac 安装CocoaPods报错解决 :Ignoring ffi-1.15.5 because its extensions are not built. Try: gem pristine ...

报错信息
Ignoring ffi-1.15.5 because its extensions are not built. Try: gem pristine ffi --version 1.15.5
/opt/homebrew/Cellar/ruby/3.1.2/lib/ruby/3.1.0/rubygems/resolver/conflict.rb:47:in `conflicting_dependencies': undefined method `request' for nil:NilClass (NoMethodError)

    [@failed_dep.dependency, @activated.request.dependency]
                                       ^^^^^^^^
    from /opt/homebrew/Cellar/ruby/3.1.2/lib/ruby/3.1.0/rubygems/exceptions.rb:61:in `conflicting_dependencies'
    from /opt/homebrew/Cellar/ruby/3.1.2/lib/ruby/3.1.0/rubygems/exceptions.rb:55:in `initialize'
    from /opt/homebrew/Cellar/ruby/3.1.2/lib/ruby/3.1.0/rubygems/resolver.rb:193:in `exception'
    from /opt/homebrew/Cellar/ruby/3.1.2/lib/ruby/3.1.0/rubygems/resolver.rb:193:in `raise'
    from /opt/homebrew/Cellar/ruby/3.1.2/lib/ruby/3.1.0/rubygems/resolver.rb:193:in `rescue in resolve'
    from /opt/homebrew/Cellar/ruby/3.1.2/lib/ruby/3.1.0/rubygems/resolver.rb:191:in `resolve'
    from /opt/homebrew/Cellar/ruby/3.1.2/lib/ruby/3.1.0/rubygems/request_set.rb:411:in `resolve'

网上找了一大推,一顿骚操作,也不知道那句起作用了

//安装ffi,具体看自己报错的版本
gem pristine ffi --version 1.15.5
//有时Command Line Tools出了问题,可以先尝试恢复默认设置来解决
//(我的感觉就是这里的问题)
sudo xcode-select --reset
//再安装CocoaPods
sudo gem install cocoapods
//查看版本,可以查看说明就成功了
pod --version

你可能感兴趣的:(Mac 安装CocoaPods报错解决 :Ignoring ffi-1.15.5 because its extensions are not built. Try: gem pristine ...)