Ios (Gem::MissingSpecError)pod安装后

Ios (Gem::MissingSpecError)pod安装后,ios,ruby,cocoapods,Ios,Ruby,Cocoapods,我已经预装了ruby 2.6。所以我跑了- brew leaves brew update-reset brew install ruby 然后我要加上这些- 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

我已经预装了ruby 2.6。所以我跑了-

brew leaves
brew update-reset
brew install ruby
然后我要加上这些-

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"
在我的
.bash\u配置文件中

现在我安装了最新版本的ruby。但之前的版本没有被删除

ruby 3.0.1p64 (2021-04-05 revision 0fb782ee38) [x86_64-darwin19]
现在当我跑的时候-

sudo gem install cocoapods 
它安装成功,但当我运行

pod --version
它给-

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
我明白了-

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
那么,我如何解决(Gem::missingspeccerror)错误呢

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