React Native ERROR: Failed to build gem native extension.

ReactJS Jul 12, 2023

This occurs when I try to install CocoaPod as recommended in the React Native Docs referred here

https://reactnative.dev/docs/environment-setup#cocoapods

sudo gem install cocoapods

Solution

In my case I solve this by upgrading Ruby to 2.6.6

Warning: Please check the version again. This is as of 18 April 2021

This is done cleaner by Ruby version manager

https://rvm.io/

curl -sSL https://get.rvm.io | bash -s stable

Then do the upgrade

rvm install ruby-2.6.6
rvm use ruby-2.6.6
rvm --default use 2.6.6

And it works !

Cheers !

Tags

TeamCMD

We are CODEMONDAY team and provide a variety of content about Business , technology, and Programming. Let's enjoy it with us.