Error executing program on simulator

Hi Team,

I am getting following error when executing a program on the simulator.

Warning: CocoaPods is installed but broken. Skipping pod install.
  You appear to have CocoaPods installed but it is not working.
  This can happen if the version of Ruby that CocoaPods was installed with is different from the one being used to invoke it.
  This can usually be fixed by re-installing CocoaPods.
For re-installation instructions, see https://guides.cocoapods.org/using/getting-started.html#installation

CocoaPods not installed or not in valid state.
Error launching application on iPhone 17.

I tried to install cocoapods using below command which gave me another error.

gem install cocoapods

This gave me below error.

ERROR:  Error installing cocoapods:
	The last version of securerandom (>= 0.3) to support your Ruby & RubyGems was 0.3.2. Try installing it with `gem install securerandom -v 0.3.2` and then running the current command again
	securerandom requires Ruby version >= 3.1.0. The current ruby version is 2.6.10.210.

I tried to execute the suggested command

gem install securerandom -v 0.3.2

This installed successfully. Then the installation of cocoapods is still not successful which gave me another error related to drb.

what is the recommended approach, follow the suggestions?

What is the recommended approach for upgrading ruby to latest version?

I assumed that this will be taken care by upgrading Xcode which is latest on my system.

Can anyone help!

Error executing program on simulator
 
 
Q