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

Ruby 3.2.1搭建Jekyll时gem install eventmachine -v '1.2.7'失败如何解决?

解决Ruby 3.2.1搭建Jekyll时bundle安装eventmachine失败的问题

问题现象

执行bundle命令时触发eventmachine编译失败,核心报错信息如下:

current directory: /Users/chandanj/.rvm/gems/ruby-3.2.1/gems/eventmachine-1.2.7/ext
make DESTDIR\= sitearchdir\=./.gem.20230620-52033-h7p7oy sitelibdir\=./.gem.20230620-52033-h7p7oy
compiling binder.cpp
In file included from binder.cpp:20:
./project.h:119:10: fatal error: 'openssl/ssl.h' file not found
#include <openssl/ssl.h>
         ^~~~~~~~~~~~~~~
1 error generated.
make: *** [binder.o] Error 1

make failed, exit code 2

An error occurred while installing eventmachine (1.2.7), and Bundler cannot continue.

错误原因

eventmachine 1.2.7编译时依赖OpenSSL的开发头文件,当前系统未安装该依赖或编译器无法识别其路径。

解决步骤

  1. 安装OpenSSL开发包(针对macOS系统,使用Homebrew):
    brew install openssl
    
  2. 指定OpenSSL路径手动安装eventmachine:
    gem install eventmachine -v '1.2.7' -- --with-openssl-dir=$(brew --prefix openssl)
    
  3. 重新执行bundle命令:
    bundle install
    

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.07.18 16:45:12