在 macOS Big Sur 上安装 cocoa pod 时出错

Ash*_*har 8 macos cocoapods flutter macos-big-sur

我正在我的机器上设置 flutter。但是,当我尝试使用安装 cocoapods 时

sudo gem install cocoapods
Run Code Online (Sandbox Code Playgroud)

我收到此错误:

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.15.0/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 ./siteconf20210324-1667-1wwdce5.rb extconf.rb
checking for ffi.h... no
checking for ffi.h in /usr/local/include,/usr/include/ffi,/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/ffi,/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/ffi... yes
checking for ffi_prep_closure_loc() in -lffi... yes
checking for ffi_prep_cif_var()... yes
checking for ffi_raw_call()... yes
checking for ffi_prep_raw_closure()... yes
creating extconf.h
creating Makefile

current directory: /Library/Ruby/Gems/2.6.0/gems/ffi-1.15.0/ext/ffi_c
make "DESTDIR=" clean

current directory: /Library/Ruby/Gems/2.6.0/gems/ffi-1.15.0/ext/ffi_c
make "DESTDIR="
make: *** No rule to make target `"/Volumes/macOS', needed by `AbstractMemory.o'.  Stop.

make failed, exit code 2

Gem files will remain installed in /Library/Ruby/Gems/2.6.0/gems/ffi-1.15.0 for inspection.
Results logged to /Library/Ruby/Gems/2.6.0/extensions/universal-darwin-20/2.6.0/ffi-1.15.0/gem_make.out
Run Code Online (Sandbox Code Playgroud)

这是由于分区名称中包含“空格”造成的吗?我安装操作系统的驱动器名称是“macOS Big Sur”,而 flutter 驻留在另一个分区“macOS Storage”上

有人可以帮忙吗?

Mαπ*_*π.0 15

这可以通过以下方式解决:

sudo gem install -n /usr/local/bin cocoapods -v 1.8.4
Run Code Online (Sandbox Code Playgroud)

如果您需要安装,CocoaPods 1.10.0 +可以使用HomeBrew并在命令行中使用以下命令:

brew install cocoapods
Run Code Online (Sandbox Code Playgroud)