2015-12-12 75 views
1

這是我在mac os上安裝eventmachine時遇到的一個錯誤,我嘗試了所有答案,但無法解決它直到現在和這裏是錯誤日誌。錯誤,而'sudo gem在mac os上安裝eventmachine -v 1.0.8'

<pre><code>Building native extensions. This could take a while... 
 
ERROR: Error installing eventmachine: 
 
\t ERROR: Failed to build gem native extension. 
 

 
    /usr/local/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=$(cflags) -pipe -I/opt/local/include -Wall -Wextra -Wno-deprecated-declarations -Wno-ignored-qualifiers -Wno-unused-result 
 
CPPFLAGS=-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:0: 
 
project.h:29:20: fatal error: iostream: No such file or directory 
 
#include <iostream> 
 
        ^
 
compilation terminated. 
 
make: *** [binder.o] Error 1 
 

 
make failed, exit code 2 
 

 
Gem files will remain installed in /usr/local/lib/ruby/gems/2.1.0/gems/eventmachine-1.0.8 for inspection. 
 
Results logged to /usr/local/lib/ruby/gems/2.1.0/extensions/x86_64-darwin-15/2.1.0-static/eventmachine-1.0.8/gem_make.out</code></pre>

請任何幫助,將不勝感激。

回答

0

這是你的問題:

make "DESTDIR=" 
compiling binder.cpp 
In file included from binder.cpp:20:0: 
project.h:29:20: fatal error: iostream: No such file or directory 
#include <iostream> 

什麼發生是編譯器無法找到project.h的包括的iostream。你可以玩手動安裝它,下面提供的鏈接。

https://github.com/eventmachine/eventmachine/wiki/Building-EventMachine

此鏈接可能會幫助您解決問題。

C++ Hello World trouble on OSX10.8

另一個潛在的速戰速決是手動安裝它,看看是否添加擴展頭將解決您的問題。

#include <iostream.h> 
+0

我試圖手動打造的寶石,但仍是同樣的問題存在,每一件事情是正確安裝(即xcode,gcc,g ++ ...) –

+0

你嘗試了最後一步嗎?請記住,如果您有一個較舊的編譯器,則可能需要頭擴展,這意味着當您嘗試手動安裝它時,需要先進入並將其添加。您遇到的唯一問題是無法找到iostream。此外,嘗試使用舊版本的Ruby,因爲我知道某些gem無法正確編譯最新版本的Ruby,原因是它無法正確找到devkit。 –

+0

是我試圖添加iostream.h,而日誌告訴我沒有找到iostream.h頭。 當我試圖使用ruby-2.0.0來安裝它時,它工作,但與2.1.5它給出了上述錯誤。 –

0

如果您使用的是Mac OSX EL隊長,OpenSSL的頭是不是默認安裝的,因此嘗試安裝OpenSSL的。如果OpenSSL是已安裝的請嘗試使用下面的命令來重新鏈接

brew link openssl --force 

詳見本期更多細節 - https://github.com/eventmachine/eventmachine/issues/643