如何解决bundle install时eventmachine (1.2.7)安装失败问题
解决eventmachine (1.2.7)安装失败问题
An error occurred while installing eventmachine (1.2.7), and Bundler cannot continue.
In Gemfile:
github-pages was resolved to 228, which depends on
jekyll-avatar was resolved to 0.7.0, which depends on
jekyll was resolved to 3.9.3, which depends on
em-websocket was resolved to 0.5.3, which depends on
eventmachine
- 先安装编译依赖:
- macOS:执行
xcode-select --install安装Xcode命令行工具,确保具备基础编译环境 - Debian/Ubuntu:执行
sudo apt-get install build-essential libssl-dev安装编译套件和SSL依赖库
- macOS:执行
- 指定eventmachine的SSL编译参数(适用于macOS用Homebrew安装openssl的场景):
先执行bundle config build.eventmachine --with-openssl-dir=$(brew --prefix openssl@1.1),再重新运行bundle install - 若上述方法无效,单独安装兼容版本的eventmachine:
执行gem install eventmachine -v 1.2.7 -- --with-openssl-dir=$(brew --prefix openssl@1.1),安装完成后再执行bundle install - 检查Ruby版本:github-pages 228适配Ruby 2.7.x或3.0.x,若当前Ruby版本过高(如3.2+),用rbenv/rvm切换到兼容版本后重试
- 清理Bundle缓存:执行
bundle clean --force清除旧缓存文件,再重新执行bundle install
内容的提问来源于stack exchange,提问作者Jorden Sanchez
相关产品推荐
相关产品推荐

