【问题标题】:"You are connecting to Redis v3.2.9, Sidekiq requires Redis v4.0.0 or greater?"“您正在连接到 Redis v3.2.9,Sidekiq 需要 Redis v4.0.0 或更高版本?”
【发布时间】:2020-04-15 22:02:37
【问题描述】:

我最近在我的 Gemfile 中更新了 Sidekiq:

gem 'sidekiq', '~> 6.0', '>= 6.0.4'
gem 'redis', '~> 4.1', '>= 4.1.3'

但自从更新后,我在终端中运行sidekiq 时出现此错误:

You are connecting to Redis v3.2.9, Sidekiq requires Redis v4.0.0 or greater.

我确保卸载了旧版本的 Sidekiq 和 Redis,但 Sidekiq 仍在尝试连接到 3.2.9。我的 Gemfile.lock 有:

sidekiq (6.0.4)
  connection_pool (>= 2.2.2)
  rack (>= 2.0.0)
  rack-protection (>= 2.0.0)
  redis (>= 4.1.0)

我误读了这个错误吗?我如何告诉 Sidekiq 使用正确版本的 Redis?

【问题讨论】:

    标签: ruby-on-rails redis sidekiq


    【解决方案1】:

    这不是 gem 依赖问题。我跑了brew upgrade redis,重新启动redis-server,然后就解决了。

    【讨论】:

      【解决方案2】:

      对我来说,问题是 bundle exec foreman s 使用了指定的 Redis 版本 here。使用6.2.5 进行猴子修补有帮助,但修复它的正确方法是将您的 redis 版本固定在 app_config.yml 中:

      redis:
          <<: *redis
          version: 4.2.0 # or the version you are using
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2020-07-02
        • 1970-01-01
        • 1970-01-01
        • 2019-03-03
        • 2013-01-28
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多