问题描述
我对 Apple 和应用程序编程非常陌生,所以如果我没有以完美的格式"提问,请原谅我.你可能会期待...
I am very new to Apple and app programming so please forgive me if I am not asking my questions in the perfect "format" that you might be expecting...
几天前我买了运行在 M1 芯片上的 MacBook Air,想用 Xcode 和 React Native 编程.当我执行常用命令npx react-native init AwesomeProject"时,我遇到了其他人也遇到的错误:
I bought my MacBook Air running on M1 chip just few days ago and would like to program with Xcode and React Native. As I do the common command "npx react-native init AwesomeProject" I got into the error which I saw quite some other people also run into:
error Error: Failed to install CocoaPods dependencies for iOS project, which is required by this template.
我尝试了其他帖子中提供的所有建议(假设我正确理解了补救措施并相应地进行了更改),但似乎没有一个对我有用.
I tried all of the suggestions available on other posts (assuming I am understanding the remedies correctly and making the changes accordingly) but none seem to work for me.
我还尝试了默认的建议解决方案:
I tried also the default suggested solution which is:
Please try again manually: "cd ./AwesomeProject/ios && pod install".
而且我似乎得到了一些与其他人不同的东西,那就是:
And I seem to get something different from others, which is:
分析依赖项从以下位置获取 DoubleConversion
的 podspec../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec
从 RCT-Folly
获取 podspec../node_modules/react-native/third-party-podspecs/RCT-Folly.podspec
从 glog
获取 podspec../node_modules/react-native/third-party-podspecs/glog.podspec
/Library/Ruby/Gems/2.6.0/gems/ffi-1.15.1/lib/ffi/library.rb:275: [BUG]0x0000000102a08000 处的总线错误 ruby 2.6.3p62 (2019-04-16 修订版)67580) [universal.arm64e-darwin20]
然后
您可能在 Ruby 解释器或扩展中遇到了错误图书馆.
这与我的 Ruby 解释器有关吗?如果是,我可以使用哪些命令来解决问题???
Is it something to do with my Ruby interpreter? If yes, what are the commands I could use to solve the issue???
推荐答案
https://github.com/CocoaPods/CocoaPods/issues/10349#issuecomment-849468291
brew install cocoapods
sudo arch -x86_64 gem install ffi
arch -x86_64 pod install
这篇关于React-Native 错误 + Ruby 解释器中的错误:无法为 iOS 项目安装 CocoaPods 依赖项,这是此模板所必需的的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!