You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Ruby Rails报错:Bundler无法找到兼容版本的bundler gem该如何解决?

Bundler版本不兼容问题解决

错误信息:

Bundler无法找到兼容版本的gem "bundler":
  在Gemfile中:
    bundler (~> 2.2)

    rails (= 6.1.4.6) 已解析为6.1.4.6,它依赖于
      bundler (>= 2.2.0)

 当前Bundler版本:
    bundler (2.1.4)
此Gemfile需要不同版本的Bundler。
或许你需要通过运行`gem install bundler`来更新Bundler?

在相关源中均未找到gem 'bundler (~> 2.2)',而该gem是gem 'rails (= 6.1.4.6)'所需的:
  本地Ruby安装环境

解决步骤:

  • 卸载当前旧版本Bundler:
    gem uninstall bundler -v 2.1.4
    
  • 安装符合要求的2.2.x版本Bundler:
    gem install bundler -v "~> 2.2"
    
  • 确认版本安装成功:
    bundler -v
    
  • 重新执行bundle安装依赖:
    bundle install
    

内容的提问来源于stack exchange,提问作者TEX

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.23 13:36:14