I am working on a Mac, M1 chip. I was working in React Native, when something happened with my system’s configurations while trying to get the Android Build to work. No npm
, npx
, (any node
commands really) worked, I couldn’t do anything with my Pods, and essentially just everything was broken. I deleted and uninstalled everything to do with Node
, Java
, and Cocoapods
but the issue I’m facing now is that I cannot install CocoaPods
I am following the directions from here and I am on my third try to just start a new React App. The Project will build, but I cannot install any pods and the whole app seems to not know that its supposed to be running off React
as it won’t let me use imported components.
So I have a plethora of issues in front of me, but the biggest is my inability to install CocoaPods.
I run…
brew install CocoaPods
and get the following return…
Warning: cocoapods 1.11.3 is already installed and up-to-date.
But upon running npx react-native init
I get the following error…
error Error: Failed to install CocoaPods dependencies for iOS project, which is required by this template.
So I tried as I was instructed, and attempted to run…
sudo arch -x86_64 gem install ffi
Which gives me this…
make install failed, exit code 2
And since that fails, I cannot successfully run…
arch -x86_64 pod install
So it looks like my code is breaking before I can even type a single line. I’ve been trying to just create a new React Project for hours now… this seems very overly complicated
2
Answers
Update your ruby to recent version, for that you can use
rbenv
viahomebrew
. After that install cocoapods viagem install
There must have been some sort of corruption or only partially installed dependency. I ended up wiping my hard drive and restoring everything, it worked after that