It seems this section is a bit outdated. I managed to install CocoaPods with the built-in ruby on Sonoma on a M2 (ARM).
If you want to include this in the docs, here's my take on it:
Installing CocoaPods without Homebrew or sudo
You can install CocoaPods directly with the Ruby bundler shipped with MacOS and without needing sudo support.
First of all decide where to store the Ruby gems (in this example under ~/.gem), then set the GEM_HOME environment variable and update your PATH (you can also add this to your .bashrc or other login script you use).
You can then use the bundle command to create a small Gemfile and install Cocoapods:
$ bundle init && bundle add cocoapods
Compared to the gem install command, using bundle with a Gemfile will resolve all dependencies considering the currently installed version of Ruby and RubyGems.
https://github.com/ionic-team/capacitor-docs/blob/19b3e824c9794577bb59ec530e4d064ba9c0c1a2/docs/main/getting-started/environment-setup.md?plain=1#L91-L109
It seems this section is a bit outdated. I managed to install CocoaPods with the built-in
ruby
on Sonoma on a M2 (ARM).If you want to include this in the docs, here's my take on it:
Installing CocoaPods without Homebrew or sudo
You can install CocoaPods directly with the Ruby bundler shipped with MacOS and without needing
sudo
support.First of all decide where to store the Ruby gems (in this example under
~/.gem
), then set theGEM_HOME
environment variable and update yourPATH
(you can also add this to your.bashrc
or other login script you use).You can then use the
bundle
command to create a smallGemfile
and install Cocoapods:Compared to the
gem install
command, usingbundle
with aGemfile
will resolve all dependencies considering the currently installed version of Ruby and RubyGems.