The MacBook Air with a 15-inch M3 chip, released in 2024, already has the gem installed. You can verify its version using the commands gem -v
and ruby -v
. We still need to install a few more things.
Install Homebrew
Install via /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
Open the ~/.zshrc
for zsh or ~/.bash_profile
for bash. And export PATH="/opt/homebrew/opt/ruby/bin:$PATH"
and apply changes by running source ~/.zshrc # or source ~/.bash_profile
You can check brew version via brew -v
Install rvm
\curl -sSL https://get.rvm.io | bash -s stable –ruby
echo ‘source $HOME/.rvm/scripts/rvm’ >> ~/.zshrc # or ~/.bash_profile
source ~/.zshrc # or source ~/.bash_profile
rvm install 3.1.2 # Replace with the desired Ruby version
rvm use 3.1.2 –default
ruby -v
Install CoCoPods
gem install cocoapods
If it prompts several packages version are not right, just install them according to instructions and you will install them successfully.
Finally check pod pod --version