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

标签 macos flutter cocoapods macos-big-sur

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

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.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
这是由于分区名称在其名称中包含“空格”吗?我安装操作系统的驱动器名称是“macOS Big Sur”,而 flutter 驻留在另一个分区上,即“macOS Storage”
有人可以帮忙吗?

最佳答案

这将通过以下方式解决:

sudo gem install -n /usr/local/bin cocoapods -v 1.8.4
如果您需要安装 CocoaPods 1.10.0 +您可以使用 HomeBrew并在命令行中使用以下命令:
brew install cocoapods

关于macos - 在 macOS Big Sur 上安装 cocoa pod 时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/66784563/

相关文章:

flutter - 如何在flutter中创建如下圆形动画

ios - FIRApp 链接器错误 ["_OBJC_CLASS_$_FIRApp"]

ios - Rdio 和 Google Core 库之间的静态库函数名称冲突

cocoa - 如何在 Mac OS X 应用程序中实现 UITabBar View ?

objective-c - 如何覆盖 NSWindow?

macos - 有哪些方法或工具可用于检查 Mac 桌面应用程序中的元素

flutter - 在动画按钮类上使用回调

cocoa - 如何逐步从NSTask中检索数据?

flutter FirebaseAuth : SignInWithEmailAndPassword unable to handle error when the email address is badly formatted

ios - Cococapods 框架导致警告 "Class XY is implemented in both"