Pod 安装:忽略 ffi-1.13.1,因为它的扩展没有构建。尝试: gem pristine ffi --version 1.13.1

时间:2020-12-18 21:14:33

标签: ios swift xcode installation cocoapods

我尝试在我的 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。不确定其他人是否有此问题。

2 个答案:

答案 0 :(得分:2)

更新到 Big Sur 后遇到同样的问题

重新安装 cocoapods 对我有用

gem install cocoapods

如果出现以下错误,

您可能需要为 ruby​​ 开发安装单独的包 环境,例如 ruby​​-dev 或 ruby​​-devel。

安装这个

xcode-select --install

答案 1 :(得分:0)

xcode-select --install

这对我有用,在更新您的 pod 之前,请运行上面的行,然后使用您的 pod 更新或安装