The error message “can’t find gem cocoapods (>= 0.a) with executable pod (Gem::GemNotFoundException)” indicates that the RubyGem system cannot locate the cocoapods
gem or its executable (pod
command). This issue commonly occurs in Ruby environments, and it often relates to problems with the RubyGem setup or the installation of the CocoaPods gem.
Here are the Methods you can take to resolve this issue:
First Solution:
Open the terminal, go to the project directory, and run the below command.
cd ios
bundle install
Running "bundle install"
installs the Ruby gems specified in your project’s Gemfile. If you encounter issues during the installation.
Second Solution:
If you are still getting the same issue even after trying the first solution, then you can run the below command.
cd ..
sudo gem install cocoapods
This command installs the CocoaPods gem.
Third Solution:
If the above issues persist, try uninstalling and then reinstalling CocoaPods.
sudo gem uninstall cocoapods
sudo gem install -n /usr/local/bin cocoapods
is used to install CocoaPods globally and ensure that the executable (pod
command) is available in a directory that is part of your system’s PATH (/usr/local/bin
).
That’s it for this blog. I hope, this blog really helped you to fix the issue. if you have any queries or suggestions. You can connect with us through the contact section. We are also available on YouTube. You can also follow the video given below.