React Native ERROR: Failed to build gem native extension.
codemonday
React Native ERROR: Failed to build gem native extension.
move up
linefacebookx
move up
linefacebookx

React Native ERROR: Failed to build gem native extension.

Jul 12, 2023
ReactJS

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 !