Ruby Available/installed versions of this gem

zhugexinxin · 2023年06月05日 · 最后由 zhugexinxin 回复于 2023年06月05日 · 261 次阅读

在执行 sidekiq -C config/sidekiq.yml,发生了下面错误

WARN: Unresolved or ambiguous specs during Gem::Specification.reset:
      minitest (>= 5.1)
      Available/installed versions of this gem:
      - 5.18.0
      - 5.16.3

根据上面提示版本有多个,我就去查找 gemfile.lock,但是没发现有什么问题,下面的是 gemfile.lock 查找的 minitest,还有个 5.16.3

activesupport (7.0.4.3)
      concurrent-ruby (~> 1.0, >= 1.0.2)
      i18n (>= 1.6, < 2)
      minitest (>= 5.1)
      tzinfo (~> 2.0)
minitest (5.18.0)

然后 gem list,发现

minitest (5.18.0, 5.16.3)

gem uninstall minitest -v 5.16.3

ERROR:  While executing gem ... (Gem::InstallError)
    minitest is not installed in GEM_HOME, try:
    gem uninstall -i /usr/local/lib/ruby/gems/3.2.0 minitest
    /usr/local/lib/ruby/3.2.0/rubygems/uninstaller.rb:124:in `uninstall'
    /usr/local/lib/ruby/3.2.0/rubygems/commands/uninstall_command.rb:195:in `uninstall'
    /usr/local/lib/ruby/3.2.0/rubygems/commands/uninstall_command.rb:181:in `uninstall_gem'
    /usr/local/lib/ruby/3.2.0/rubygems/commands/uninstall_command.rb:175:in `block in uninstall_specific'
    /usr/local/lib/ruby/3.2.0/rubygems/commands/uninstall_command.rb:167:in `each'
    /usr/local/lib/ruby/3.2.0/rubygems/commands/uninstall_command.rb:167:in `uninstall_specific'
    /usr/local/lib/ruby/3.2.0/rubygems/commands/uninstall_command.rb:133:in `execute'
    /usr/local/lib/ruby/3.2.0/rubygems/command.rb:323:in `invoke_with_build_args'
    /usr/local/lib/ruby/3.2.0/rubygems/command_manager.rb:251:in `invoke_command'
    /usr/local/lib/ruby/3.2.0/rubygems/command_manager.rb:191:in `process_args'
    /usr/local/lib/ruby/3.2.0/rubygems/command_manager.rb:149:in `run'
    /usr/local/lib/ruby/3.2.0/rubygems/gem_runner.rb:51:in `run'
    /usr/local/bin/gem:10:in `<main>'

好奇怪

最后发现 docker ruby 镜像自带了这个版本的 gem

zhugexinxin 关闭了讨论。 06月05日 14:04
需要 登录 后方可回复, 如果你还没有账号请 注册新账号