can't find gem cocoapods (>= 0.a) with executable pod (react-native pod install)

Viewed 2248

I just start a react-native project. However, this question had me for a day. I tried all possible way to solve it. For example,

sudo gem uninstall cocoapods
rvm uninstall
brew install cocoapods

However, there is no luck for me. I would like to point out that I can pod --version under other path but issue occur when I try to pod under my project path. I also tried to set rvm default version to 2.7.5 but issue still happen. Also, I am not using Apple M1

Traceback (most recent call last):
    4: from /Users/nicholas/.rvm/gems/ruby-2.7.5/bin/ruby_executable_hooks:22:in `<main>'
    3: from /Users/nicholas/.rvm/gems/ruby-2.7.5/bin/ruby_executable_hooks:22:in `eval'
    2: from /Users/nicholas/.rvm/gems/ruby-2.7.5/bin/pod:23:in `<main>'
    1: from /Users/nicholas/.rvm/rubies/ruby-2.7.5/lib/ruby/2.7.0/rubygems.rb:296:in `activate_bin_path'
/Users/nicholas/.rvm/rubies/ruby-2.7.5/lib/ruby/2.7.0/rubygems.rb:277:in `find_spec_for_exe': can't find gem cocoapods (>= 0.a) with executable pod (Gem::GemNotFoundException)
1 Answers

Try running bundle install in the root of your project. Then either go to ios and run pod install or use npx pod-install from the project root.

Related