首页 > 解决方案 > Pod MissingSpecError、Ruby、Gem、Cocoapods 等

问题描述

当我跑步时,pod我现在得到

$ pod
Traceback (most recent call last):
    3: from /usr/local/bin/pod:22:in `<main>'
    2: from /usr/local/Cellar/ruby/2.6.0_1/lib/ruby/2.6.0/rubygems/core_ext/kernel_gem.rb:65:in `gem'
    1: from /usr/local/Cellar/ruby/2.6.0_1/lib/ruby/2.6.0/rubygems/dependency.rb:323:in `to_spec'
/usr/local/Cellar/ruby/2.6.0_1/lib/ruby/2.6.0/rubygems/dependency.rb:311:in `to_specs': Could not find 'cocoapods' (>= 0.a) among 7 total gem(s) (Gem::MissingSpecError)
Checked in 'GEM_PATH=/Users/User1/.gem/ruby/2.6.0:/usr/local/lib/ruby/gems/2.6.0:/usr/local/Cellar/ruby/2.6.0_1/lib/ruby/gems/2.6.0', execute `gem env` for more information

我试过重新安装 Cocoapods,删除所有宝石等。

某处有评论说这个问题是由于引用了错误的红宝石路径引起的,但哪个应该是“正确的”?一切工作了 4 年,但现在 Pod 无法运行,我不明白。

标签: rubyrubygemscocoapods

解决方案


cocoapods 没有安装得到它

1)brew reinstall cocoapods

(将出现有关链接的错误消息)

2)brew link --overwrite cocoapods

(修复链接)

我不知道为什么这是一个开始的问题,因为它也可以使用 pure 来工作gem,但我现在很高兴


推荐阅读