簡體   English   中英

無法在 macOS 10.15.4 上安裝 Cocoapods

[英]Unable to install Cocoapods on macOS 10.15.4

當我執行sudo gem install cocoapods它返回以下內容:

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 ./siteconf20200524-27428-t6f6h6.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

知道問題是什么嗎?

如果沒有,請先安裝 Homebrew: https://brew.sh/index_pt-br

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

二、如果沒有安裝ruby: https://www.ruby-lang.org/pt/documentation/installation/

brew install ruby

您也可以按照以下步驟操作: https://gist.github.com/monicao/d372716cdfbb7e9cf692

然后,關閉您的終端並重新打開它。

始終使用 sudo 安裝 cocoapods:

sudo gem install cocoapods

此外,您需要安裝 Xcode 的開發者工具。 最簡單的方法是通過終端( 這個問題

xcode-select --install

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM