pod知识点

报错这个

pod --version
/opt/homebrew/Cellar/ruby/3.4.3/lib/ruby/3.4.0/rubygems.rb:269:in 'Gem.find_spec_for_exe': can't find gem cocoapods (>= 0.a) with executable pod (Gem::GemNotFoundException)
    from /opt/homebrew/Cellar/ruby/3.4.3/lib/ruby/3.4.0/rubygems.rb:288:in 'Gem.activate_bin_path'
    from /usr/local/bin/pod:25:in '<main>'pod --version
/opt/homebrew/Cellar/ruby/3.4.3/lib/ruby/3.4.0/rubygems.rb:269:in 'Gem.find_spec_for_exe': can't find gem cocoapods (>= 0.a) with executable pod (Gem::GemNotFoundException)
    from /opt/homebrew/Cellar/ruby/3.4.3/lib/ruby/3.4.0/rubygems.rb:288:in 'Gem.activate_bin_path'
    from /usr/local/bin/pod:25:in '<main>'

✅ 修复步骤如下:

输入命令
① 查看当前的 pod 链接情况

which -a pod
/usr/local/bin/pod        # ❌ 旧的(gem)
/opt/homebrew/bin/pod     # ✅ 正确的(brew)

② 删除旧的 pod 链接

sudo rm /usr/local/bin/pod

③ 再次检查 pod --version

pod --version

就会版本输出号了

如果你要彻底确保环境没冲突,也可以执行这个:

hash -r  # 清理 shell 缓存
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容