【问题标题】:Error installing cocoapods on Catalina 10.15.2在 Catalina 10.15.2 上安装 cocoapods 时出错
【发布时间】:2020-05-27 00:38:06
【问题描述】:

刚开始学swift,发现可以从cocoapods获取很多库,所以我开始通过运行sudo gem install cocoapods安装cocoapods,但是在安装过程中出现以下错误:

Successfully installed concurrent-ruby-1.1.6
Successfully installed i18n-0.9.5
Successfully installed thread_safe-0.3.6
Successfully installed tzinfo-1.2.7
Successfully installed activesupport-4.2.11.3
Successfully installed nap-1.1.0
Successfully installed fuzzy_match-2.0.4
Successfully installed httpclient-2.8.3
Successfully installed algoliasearch-1.27.2
Building native extensions. This could take a while...
ERROR:  Error installing cocoapods:
    ERROR: Failed to build gem native extension.

    current directory: /Library/Ruby/Gems/2.6.0/gems/ffi-1.12.2/ext/ffi_c
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby -I /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0 -r ./siteconf20200527-3399-1uix5ob.rb extconf.rb
mkmf.rb can't find header files for ruby at /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/include/ruby.h

You might have to install separate package for the ruby development
environment, ruby-dev or ruby-devel for example.

extconf failed, exit code 1

Gem files will remain installed in /Library/Ruby/Gems/2.6.0/gems/ffi-1.12.2 for inspection.
Results logged to /Library/Ruby/Gems/2.6.0/extensions/universal-darwin-19/2.6.0/ffi-1.12.2/gem_make.out

我正在运行带有 Xcode 10.3 的 macOS Catalina 10.15.2,不确定是不是因为 masOS 已过时,如果是,有什么方法可以在不更新 macOS 的情况下解决安装问题?

【问题讨论】:

    标签: ruby rubygems cocoapods


    【解决方案1】:

    我从 ma​​cOS 恢复 > 磁盘工具 中删除了 Macintosh HD,然后又从 ma​​cOS 恢复 重新安装了 macOS Catalina 后,我也发生了同样的事情。

    现在,我在 ma​​cOS Catalina 10.15.7 上运行 sudo gem install cocoapods 时发生了这个错误。

    我还不确定为什么,但是通过 Homebrew 安装 cocoapods 对我有用。

    brew 安装 cocoapods

    brew install cocoapods
    

    如果您还没有 Homebrew,请在终端上运行以下命令:

    /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
    

    【讨论】:

      猜你喜欢
      • 2021-03-02
      • 2020-07-15
      • 1970-01-01
      • 2020-04-11
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-11-13
      相关资源
      最近更新 更多