无法安装 cocoapods MacBook Air m1



无法运行sudo gem安装ffi我收到这个错误

错误:正在加载命令:install(LoadError(dlopen(/Library/Ruby/Gems/2.6.0/Gems/date-3.1.1/lib/date_core.bundle,9(:未找到合适的图像。确实找到:/Library/Ruby/Gems/2.6.0/Gems/date-3.1.1/lib/date_core.bundle:machi-o,但架构错误/Library/Ruby/Gems/2.6.0/Gems/date-3.1.1/lib/date_core.bundle:machi-o,但错误的体系结构-/Library/Rube/Gems/2.6.0/Gems/date-3.1.1/lib/date_core-bundle错误:执行gem时。。。(NoMethodError(nil:NilClass 的未定义方法"invoke_with_build_args">

我通过将ruby版本更新到最新版本来解决问题

您可以用这些代码行来解决它;

sudo arch -x86_64 gem install ffi
arch -x86_64 pod install

它对我有效;我希望你能用这个解决你的问题。

最新更新