Mac OS 10.15.7
ABCD-MBP:~ abcd$ which ruby
/usr/local/opt/ruby/bin/ruby
ABCD-MBP:~ abcd$ ruby -v
ruby 3.0.2p107 (2021-07-07 revision 0db68f0233) [x86_64-darwin19]
pod setup
Traceback (most recent call last):
3: from /usr/local/bin/pod:22:in `<main>'
2: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_gem.rb:65:in `gem'
1: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/dependency.rb:323:in `to_spec'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/dependency.rb:311:in `to_specs': Could not find 'cocoapods' (>= 0.a) among 48 total gem(s) (Gem::MissingSpecError)
Checked in 'GEM_PATH=/Users/abcd/.gem/ruby/2.6.0:/Library/Ruby/Gems/2.6.0:/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/gems/2.6.0', execute `gem env` for more information
I'm not getting why old version of ruby is getting referred here ?
With XCode > pod install is failing as old version of ruby is getting referred as well.
Traceback (most recent call last):
3: from /usr/local/bin/pod:22:in `<main>'
2: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_gem.rb:65:in `gem'
1: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/dependency.rb:323:in `to_spec'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/dependency.rb:311:in `to_specs': Could not find 'cocoapods' (>= 0.a) among 48 total gem(s) (Gem::MissingSpecError)
Checked in 'GEM_PATH=/Users/abcd/.gem/ruby/2.6.0:/Library/Ruby/Gems/2.6.0:/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/gems/2.6.0', execute `gem env` for more information
I tried different solutions proposed in SO but couldn't get this fixed
- uninstall all gems and install again
- uninstall pod and install again