我尝试在Xcode项目中运行pod install
,但出现以下错误
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/dependency.rb:311:in `to_specs': Could not find 'ffi' (>= 1.3.0) among 84 total gem(s) (Gem::MissingSpecError)
Checked in 'GEM_PATH=/Users/dylan/.gem/ruby/2.6.0:/Library/Ruby/Gems/2.6.0:/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/gems/2.6.0', execute `gem env` for more information
当我运行gem env
时,我得到了
RubyGems Environment:
- RUBYGEMS VERSION: 3.0.3
- RUBY VERSION: 2.6.3 (2019-04-16 patchlevel 62) [universal.x86_64-darwin20]
- INSTALLATION DIRECTORY: /Library/Ruby/Gems/2.6.0
- USER INSTALLATION DIRECTORY: /Users/dylan/.gem/ruby/2.6.0
- RUBY EXECUTABLE: /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby
- GIT EXECUTABLE: /usr/bin/git
- EXECUTABLE DIRECTORY: /usr/local/bin
- SPEC CACHE DIRECTORY: /Users/dylan/.gem/specs
- SYSTEM CONFIGURATION DIRECTORY: /Library/Ruby/Site
- RUBYGEMS PLATFORMS:
- ruby
- universal-darwin-20
- GEM PATHS:
- /Library/Ruby/Gems/2.6.0
- /Users/dylan/.gem/ruby/2.6.0
- /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/gems/2.6.0
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :backtrace => false
- :bulk_threshold => 1000
- REMOTE SOURCES:
- https://rubygems.org/
- SHELL PATH:
- /usr/local/bin
- /usr/bin
- /bin
- /usr/sbin
- /sbin
- /Library/Apple/usr/bin
之前一切都正常,我最近做的一件事是将Xcode更新为12.3和Big Sur。不确定其他人都有这个问题。
更新到Big Sur 后出现同样的问题
重新安装茧对我有效
gem install cocoapods
如果您出现以下错误,
您可能需要为ruby开发安装单独的软件包环境,例如ruby-dev或ruby-devel。
安装这个
xcode-select --install
xcode-select --install
这对我来说是有效的,在更新你的吊舱之前,请运行上面的行,然后使用你的吊舱更新或安装
如果您使用brew,请尝试brew install cocoapods
。则brew link --overwrite cocoapods