Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

React-Native Error + Bug in Ruby Interpreter: Failed to install CocoaPods dependencies for iOS project, which is required by this template

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...

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:

Analyzing dependencies Fetching podspec for DoubleConversion from ../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec Fetching podspec for RCT-Folly from ../node_modules/react-native/third-party-podspecs/RCT-Folly.podspec Fetching podspec for glog from ../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] Bus Error at 0x0000000102a08000 ruby 2.6.3p62 (2019-04-16 revision 67580) [universal.arm64e-darwin20]

and then

You may have encountered a bug in the Ruby interpreter or extension libraries.

Is it something to do with my Ruby interpreter? If yes, what are the commands I could use to solve the issue???

like image 415
Bosco Tsin Avatar asked Aug 31 '25 04:08

Bosco Tsin


1 Answers

https://github.com/CocoaPods/CocoaPods/issues/10349#issuecomment-849468291

brew install cocoapods
sudo arch -x86_64 gem install ffi
arch -x86_64 pod install
like image 68
Vasyl Nahuliak Avatar answered Sep 02 '25 17:09

Vasyl Nahuliak