安装Bundler失败求助:Ruby版本不匹配及iOS环境配置问题
问题解决方案
一、Ruby版本不匹配问题
当前Shell会话未加载正确Ruby版本,且Gemfile版本约束需严格匹配,按以下步骤处理:
- 安装Gemfile指定的2.7.4版本(规避兼容问题):
rvm install 2.7.4 rvm use 2.7.4 --default - 验证当前Ruby版本:
确认输出为ruby -vruby 2.7.4p191(或对应版本号) - 重新安装Bundler并执行项目依赖安装:
gem install bundler cd 你的项目目录 bundle install - 若项目根目录存在
.ruby-version文件,打开确认内容为2.7.4,保证和Gemfile版本约束一致。
二、iOS环境配置问题
针对iOS环境未正确配置的问题,重点检查以下核心环节:
- Xcode基础配置:
- 安装Xcode稳定版(禁用beta版),打开Xcode并同意所有许可协议,完成初始配置。
- 安装Xcode命令行工具:
xcode-select --install - 确认命令行工具路径正确:
输出应为xcode-select -p/Applications/Xcode.app/Contents/Developer
- CocoaPods配置:
sudo gem install cocoapods cd 你的项目目录/ios pod install - 依赖工具检查:
通过Homebrew安装Node.js和Watchman:brew install node watchman
内容的提问来源于stack exchange,提问作者José de Brito
相关产品推荐
相关产品推荐

