刚刚安装了El Capitan,但无法安装gem eventmachine 1.0.7.openssl1.0.2a-1.试图使用--with-ssl-dir,但似乎被忽略了.

也向他们的github repo人报告了此事.

非常感谢您的建议.谢谢

$ ls /usr/local/Cellar/openssl/1.0.2a-1/include/openssl/ssl.h
/usr/local/Cellar/openssl/1.0.2a-1/include/openssl/ssl.h

$ gem install eventmachine -v '1.0.7' -- --with-ssl-dir=/usr/local/Cellar/openssl/1.0.2a-1/include
/Users/pain/.rbenv/versions/2.1.2/bin/ruby -r ./siteconf20150612-56154-1hsjz2n.rb extconf.rb --with-ssl-dir=/usr/local/Cellar/openssl/1.0.2a-1/include
checking for rb_trap_immediate in ruby.h,rubysig.h... no
checking for rb_thread_blocking_region()... yes
checking for ruby/thread.h... yes
checking for rb_thread_call_without_gvl() in ruby/thread.h... yes
checking for inotify_init() in sys/inotify.h... no
checking for __NR_inotify_init in sys/syscall.h... no
checking for writev() in sys/uio.h... yes
checking for rb_thread_fd_select()... yes
checking for rb_fdset_t in ruby/intern.h... yes
checking for rb_wait_for_single_fd()... yes
checking for rb_enable_interrupt()... no
checking for rb_time_new()... yes
checking for sys/event.h... yes
checking for sys/queue... yes
checking for clock_gettime()... no
checking for gethrtime()... no
creating Makefile

make "DESTDIR=" clean

make "DESTDIR="
compiling binder.cpp
In file included from binder.cpp:20:
./project.h:116: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

推荐答案

$ gem install eventmachine -- --with-cppflags=-I/usr/local/opt/openssl/include                                                                                                             
Building native extensions with: '--with-cppflags=-I/usr/local/opt/openssl/include'
This could take a while...
Successfully installed eventmachine-1.0.8
1 gem installed

你也可以这样设置bundler,但我认为这是肤浅的

bundle config build.eventmachine --with-cppflags=-I/usr/local/opt/openssl/include

Ruby相关问答推荐

如何在 Ruby 中验证来自多项 Select 提示的命令行输入?

如何在 rspec 中使用 `eq` 匹配器和 `hash_include` 匹配器来获取哈希数组

如何使用正则表达式在字符串中查找特定匹配项

查看 Savon 请求 XML 而不发送到服务器

如何在 Sinatra 中解析 JSON 请求正文一次并将其公开给所有路由?

如何在不将换行符粘贴到字符串中的情况下使用puts添加额外的换行符?

我应该签入.ruby-gemset和/或.ruby-version吗?

如何在 Ruby 中初始化 Hash 中的数组

判断文件是否包含字符串

有没有比 Rspec 的 `should_receive` 更少干扰的替代方法?

如何在 Ruby 中临时重定向标准错误?

如何按字母顺序排列忽略大小写的数组?

. vs ::(点与双冒号)用于调用方法

如何在 ruby​​ 中进行命名捕获

为什么显式返回会对 Proc 产生影响?

跳过 Enumerable#collect 中的迭代

如何在Ruby中获取给定月份的天数,占年份?

使用 Ruby CSV 在导出的 CSV 中更改字段分隔符/分隔符

Ruby 类继承:什么是`<<`(双倍小于)?

Ruby:console.log?