if you get problems of pods not found and Ruby version wasn't supported, follow this step
Install Brew brew.sh
https://stackoverflow.com/a/31250347 (Skip the gem install bundler)
and then call brew install cocoapods
Huge thank you arcadesindo and Chadori for the solution!
I needed to update my game with minor changes and I got stuck with the same problems, while less than a year ago I built a build and there was no problems (by the way, my project does not use any 3rd party plugins). And now the message about an incompatible version of swift and the absence of "pods". Not finding this solution immediately I started to update the old xcode 11, but to update it, I had to reinstall MacOs to the new version, but in the end still got the same errors in xcode 14. Then after finding a solution with an incompatible version of swift I encountered a problem with the lack of some "pods" I tried first to install via "sudo gem install cocoapods" but ran into an error during the installation which I could not overcome. In the end this tip with installing brew and then installing cocoapods through it saved me.
P.S.: By the way, installing pod through the console to every build is very annoying...(( I hope all this problems will be solved some day.