I've ruby 2.6 preinstalled. So I run -
brew leaves
brew update-reset
brew install ruby
Then I've to add these -
export PATH="/usr/local/opt/ruby/bin:$PATH"
export GEM_HOME="/usr/local/lib/ruby/gems/3.0.0/bin"
export GEM_PATH="/usr/local/lib/ruby/gems/3.0.0/bin"
In my .bash_profile
Now I got the latest version of ruby installed. But the previous version was not removed.
ruby 3.0.1p64 (2021-04-05 revision 0fb782ee38) [x86_64-darwin19]
Now When I run -
sudo gem install cocoapods
Its installing successfully but that when I run
pod --version
It gives -
Traceback (most recent call last):
16: from /usr/local/Cellar/cocoapods/1.10.1_1/libexec/bin/pod:23:in `<main>'
15: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems.rb:303:in `activate_bin_path'
14: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems.rb:303:in `synchronize'
13: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems.rb:304:in `block in activate_bin_path'
12: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/specification.rb:1420:in `activate'
11: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/specification.rb:1438:in `activate_dependencies'
10: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/specification.rb:1438:in `each'
9: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/specification.rb:1452:in `block in activate_dependencies'
8: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/specification.rb:1420:in `activate'
7: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/specification.rb:1438:in `activate_dependencies'
6: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/specification.rb:1438:in `each'
5: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/specification.rb:1452:in `block in activate_dependencies'
4: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/specification.rb:1420:in `activate'
3: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/specification.rb:1438:in `activate_dependencies'
2: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/specification.rb:1438:in `each'
1: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/specification.rb:1449:in `block in activate_dependencies'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/dependency.rb:311:in `to_specs': Could not find 'minitest' (~> 5.1) among 33 total gem(s) (Gem::MissingSpecError)
Checked in 'GEM_PATH=/usr/local/lib/ruby/gems/3.0.0/bin:/usr/local/Cellar/cocoapods/1.10.1_1/libexec', execute `gem env` for more information
If I run
gem env
I'm getting this -
ubyGems Environment:
- RUBYGEMS VERSION: 3.2.15
- RUBY VERSION: 3.0.1 (2021-04-05 patchlevel 64) [x86_64-darwin19]
- INSTALLATION DIRECTORY: /usr/local/lib/ruby/gems/3.0.0/bin
- USER INSTALLATION DIRECTORY: /Users/fahimrahman/.local/share/gem/ruby/3.0.0
- RUBY EXECUTABLE: /usr/local/opt/ruby/bin/ruby
- GIT EXECUTABLE: /usr/bin/git
- EXECUTABLE DIRECTORY: /usr/local/lib/ruby/gems/3.0.0/bin/bin
- SPEC CACHE DIRECTORY: /Users/fahimrahman/.local/share/gem/specs
- SYSTEM CONFIGURATION DIRECTORY: /usr/local/Cellar/ruby/3.0.1/etc
- RUBYGEMS PLATFORMS:
- ruby
- x86_64-darwin-19
- GEM PATHS:
- /usr/local/lib/ruby/gems/3.0.0/bin
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :backtrace => false
- :bulk_threshold => 1000
- REMOTE SOURCES:
- https://rubygems.org/
- SHELL PATH:
- /usr/local/opt/ruby/bin
- /usr/local/bin
- /usr/bin
- /bin
- /usr/sbin
- /sbin
- /Library/Apple/usr/bin
- /Users/fahimrahman/.rvm/bin
So, How I can solve (Gem::MissingSpecError) error?