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

升级Apple M2后Bundler无法匹配google-protobuf 3.23.1依赖

解决Bundler无法匹配arm64-darwin平台google-protobuf依赖的问题

以下是几个可以尝试的解决步骤:

  • 清除Bundler缓存后重新安装
    先清理本地缓存的gem:
    bundle cache clean
    再重新执行安装命令:
    bundle install

  • 强制指定平台配置
    在Gemfile中针对darwin平台单独声明依赖:

    platform :darwin do
      gem "google-protobuf", "3.23.1"
    end
    

    或者直接在安装时指定平台:
    bundle install --platform darwin

  • 更新RubyGems并检查源支持
    先更新RubyGems到最新版本:
    gem update --system
    完成后再次尝试bundle install,确保源能正确识别arm64平台的gem包。

  • 手动指定平台特定版本
    如果自动匹配依然失败,可在Gemfile中直接指定arm64平台的gem:
    gem "google-protobuf", "3.23.1", platform: :darwin_arm64

  • 检查Bundler平台识别设置
    执行bundle platform查看当前Bundler识别的平台列表,确认是否包含arm64-darwin-22。如果没有,设置环境变量强制启用平台检测:
    export BUNDLE_FORCE_RUBY_PLATFORM=false
    之后重新运行bundle install。

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.07.18 00:02:39