Ios platform add command failing

My ionic capacitor add ios command fails with below error

[capacitor] ✖ Updating iOS native dependencies with pod install - failed!
[capacitor] ✖ update ios - failed!
[capacitor] [error] Ignoring ffi-1.15.5 because its extensions are not built. Try: gem pristine ffi --version 1.15.5
[capacitor]         /opt/homebrew/Cellar/ruby/3.2.2_1/lib/ruby/3.2.0/rubygems/resolver/conflict.rb:47:in `conflicting_dependencies': undefined method `request' for nil:NilClass (NoMethodError)
[capacitor]         
[capacitor]         [@failed_dep.dependency, @activated.request.dependency]
[capacitor]         ^^^^^^^^

Platform details
Apple M1 Pro -
macOS Sonoma - 14.4.1 (23E224)

@ionic/angular": “^7.8.2”
@capacitor/core": “5.7.4”
gem - v3.5.10
ruby - 3.0.0p0
node - v19.9.0
npm - 9.6.3

Have you tried running the command the error message says to try?