【问题标题】:Can't install middleman due to gem install failure由于 gem 安装失败,无法安装中间人
【发布时间】:2015-10-09 21:34:58
【问题描述】:

我尝试使用bundle install 安装Middleman 并获得以下信息:

Installing eventmachine 1.0.8 with native extensions

Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

/usr/local/var/rbenv/versions/2.1.7/bin/ruby extconf.rb
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 pipe2() in unistd.h... no
checking for accept4() in sys/socket.h... no
checking for SOCK_CLOEXEC in sys/socket.h... no
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.h... yes
CFLAGS= -O3 -Wno-error=shorten-64-to-32  -pipe  -Wall -Wextra -Wno-deprecated-declarations -Wno-ignored-qualifiers -Wno-unused-result
CPPFLAGS=-I/usr/local/var/rbenv/versions/2.1.7/include  -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT $(DEFS) $(cppflags) -Wall -Wextra -Wno-deprecated-declarations -Wno-ignored-qualifiers -Wno-unused-result
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 files will remain installed in /usr/local/var/rbenv/versions/2.1.7/lib/ruby/gems/2.1.0/gems/eventmachine-1.0.8 for inspection.
Results logged to /usr/local/var/rbenv/versions/2.1.7/lib/ruby/gems/2.1.0/extensions/x86_64-darwin-15/2.1.0-static/eventmachine-1.0.8/gem_make.out
An error occurred while installing eventmachine (1.0.8), and Bundler cannot
continue.
Make sure that `gem install eventmachine -v '1.0.8'` succeeds before bundling.

尝试自行安装 gem 也会失败并出现同样的错误。

我做错了什么吗?我不知道在哪里可以纠正这个问题。

【问题讨论】:

    标签: gem bundler middleman


    【解决方案1】:

    看起来这是 El Capitan 不提供 openSSL 标头的问题。

    https://github.com/eventmachine/eventmachine/issues/643

    解决方案是使用 Homebrew 或 MacPorts 安装 openssl brew install openssl

    我必须做brew link openssl --force 因为已经安装了openSSL

    【讨论】:

    【解决方案2】:

    我使用了这个,因为其他解决方案对我不起作用:

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

    【讨论】:

      猜你喜欢
      • 2015-11-29
      • 2012-11-29
      • 1970-01-01
      • 1970-01-01
      • 2014-10-18
      • 2018-10-07
      • 1970-01-01
      • 1970-01-01
      • 2014-12-05
      相关资源
      最近更新 更多