I'm trying to run the React Native Environment Setup guide.
Once inside the directory created by npx react-native init
command, I try to install the cocoapods
gem as instructed. It install successfully, and when I run which pod
, I get
/Users/user/.rvm/rubies/ruby-2.7.4/bin/pod
The issue is when I try to run any pod
commands, like pod -v
or pod install
. It behaves like I don't have that gem installed and outputs this:
Traceback (most recent call last):
4: from /Users/user/.rvm/rubies/ruby-2.7.4/bin/ruby_executable_hooks:22:in `<main>'
3: from /Users/user/.rvm/rubies/ruby-2.7.4/bin/ruby_executable_hooks:22:in `eval'
2: from /Users/user/.rvm/rubies/ruby-2.7.4/bin/pod:23:in `<main>'
1: from /Users/user/.rvm/rubies/ruby-2.7.4/lib/ruby/2.7.0/rubygems.rb:296:in `activate_bin_path'
/Users/user/.rvm/rubies/ruby-2.7.4/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)
I have no idea why I'm getting that.
I see that the pod
bin is inside the ruby-2.7.4/bin/
folder, and on the last line of the error above, it looks inside the ruby-2.7.4/lib/ruby/2.7.0/rubygems.rb
. I don't understand how the gems are handled very well, so I'm not sure if that's related. I appreciate any help.
Machine: Mac Mini M1. OS: Mac OS Monterey 12.4. RVM version: 1.29.12.