M4 Mac: React Native CocoaPods/Ruby installation issues

Hi, I am developing IOS(Android App) with React Native.


I am very confused about cocoapods and pod and how to correctly install it on my new Macbook Pro M4. I am not using bash but I am using zsh


During the preparation of my environment, it say

CocoaPods is one of the dependency management system available for iOS. CocoaPods is a Ruby gem. You can install CocoaPods using the version of Ruby that ships with the latest version of macOS.

the web site show two commands

gem install cocoapods
sudo gem install cocoapods


Note that `which pod`return nothing


I saw another command as well


brew install cocoapods


During different process, I experience several tme the following error (Command 'pod install failed)

Command `pod install` failed.

└─ Cause: pod install --repo-update --ansi exited with non-zero code: 1


Then I am confused about cocoapods and pod. Are both he same?


With my previous MacBook pro, I spend time to install cocoapod on my profile because Ruby was not the latest version on the system. But apparently, on my new Macbook Pro M4, the command ruby -v return

ruby 2.6.10p210 (2022-04-12 revision 67958) [universal.arm64e-darwin25]

which is not the latest version of ruby as the current stable version is 4.0.0.


On my previous mac book, I install the current stable version on my profile and I could (with pain) install cocoapods (or pod) which solved the above error message.


I bougt a new macbook pro M4 and I reinstalled node and all package for Rect Native 0.81 a expo 54 excepted cocoapods. Now, I need to configure the push notification and it's time to install cocoapods as it's require here


But on ym new macbook pro I would like to make sure I do it correctly and I kindly ask your help and recommandation to install Ruby and cocoapods/pod


Q1: Quould I install cocoapods with brew install cocoapods or gem install cocoapods?

Q2: what's is the difference or the common point with cocoapods and pod?


Cocoapod web site said


If using the default Ruby included with macOS, installation will require you to use sudo when installing
gems


As ruby -v print 'ruby 2.6.10p210', I suppose, I should not install cocoapod with sudo


You can use a Ruby Version manager such as RVM or rbenv
to manage multiple Ruby versions, or you can use Homebrew to install a
newer Ruby with brew install ruby.



As far I understand, I should not install cocoapods with the Ruby version of the system, then I suppose the command


gem install cocoapods


is the best option, but what does exactely


brew install ruby


Q3: Will it install the latest version on my profile? Will it upgrade the system version

Q4: What will do the command


brew install rbenv ruby-build
rbenv install 3.2.2 (or better: rbenv install 4.0.0)


in comparison with


brew install ruby


My guess

I suppose that the following will help, but it would nice if you could correct me and clarify


# All should be done in my profile
brew install rbenv ruby-build
echo 'eval "$(rbenv init - bash)"' >> ~/.zprofile
source ~/.zprofile
rbenv install 4.0.0
# rbenv global 4.0.0 # What is it?
ruby -v
gem install cocoapods

Q5: But then, what about pod and the error message

Command `pod install` failed.


I thanks you for your help and clarification and I wish you a happy new years

MacBook Pro 14″, macOS 26.2

Posted on Dec 31, 2025 5:11 AM

Reply
2 replies

Dec 31, 2025 10:11 AM in response to pierrot-la-lune

Your ask is out of scope for the Apple Support Communities. I do not use React Native, or CocoPods nor is Apple involved in their development or support.


The default Ruby that continues to be installed by macOS (v2.6.10p210) has been deprecated for years, and Cocopods now requires a minimum of Ruby 2.7.4 for installation. That rules out the outdated instructions on the Cocopod site to use the version of Ruby installed by macOS.


Even though you told rbenv to globally use Ruby 4.0, that is no assurance that Cocopods supports the just released version of Ruby 4.0, or that you have finished all necessary installation/configuration steps for Cocopods. Revisit the Cocopods documentation and/or that product team. Especially since you got that error.


You installed Ruby twice: once with homebrew, and again with rbenv. I suspect that homebrew put the Ruby bits in /opt/homebrew/bin/ruby (on an Apple Silicon Mac), and rbenv may have installed it into your home directory in a dot folder.



M4 Mac: React Native CocoaPods/Ruby installation issues

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.