简体   繁体   English

无法建立事件机器1.0.3 Mac OS X 10.9.2

[英]Can't build eventmachine 1.0.3 Mac OS X 10.9.2

I want to reinstall my ruby on rails environment, but it failed. 我想在Rails环境中重新安装红宝石,但是失败了。

I work on Mac OS X 10.9.2 , using Ruby 2.1.2 , Apple LLVM version 5.1 ( clang-503.0.40 ) 我使用Ruby 2.1.2 ,Apple LLVM版本5.1( clang-503.0.40 )在Mac OS X 10.9.2上工作

I want to run: 我要跑步:

gem install eventmachine -v '1.0.3'

But I get: 但是我得到:

Building native extensions.  This could take a while...
ERROR:  Error installing eventmachine:
    ERROR: Failed to build gem native extension.

    /Users/nm/.rbenv/versions/2.1.2/bin/ruby extconf.rb
checking for rb_trap_immediate in ruby.h,rubysig.h... no
checking for rb_thread_blocking_region()... 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_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
creating Makefile

make "DESTDIR=" clean

make "DESTDIR="
compiling binder.cpp
compiling cmain.cpp
compiling ed.cpp
ed.cpp:987:18: warning: variable length arrays are a C99 feature [-Wvla-extension]
        struct iovec iov[ iovcnt ];
                        ^
1 warning generated.
compiling em.cpp
em.cpp:75:2: warning: field 'LoopBreakerWriter' will be initialized after field 'NumCloseScheduled' [-Wreorder]
        LoopBreakerWriter (-1),
        ^
em.cpp:822:2: warning: 'rb_thread_blocking_region' is deprecated [-Wdeprecated-declarations]
        rb_thread_blocking_region (_SelectDataSelect, (void*)this, RUBY_UBF_IO, 0);
        ^
/Users/nm/.rbenv/versions/2.1.2/include/ruby-2.1.0/ruby/intern.h:870:18: note: 'rb_thread_blocking_region' declared here
DEPRECATED(VALUE rb_thread_blocking_region(rb_blocking_function_t *func, void *data1,
                 ^
/Users/nm/.rbenv/versions/2.1.2/include/ruby-2.1.0/x86_64-darwin13.0/ruby/config.h:114:52: note: expanded from macro 'DEPRECATED'
#define DEPRECATED(x) __attribute__ ((deprecated)) x
                                                   ^
em.cpp:946:6: warning: 'rb_thread_select' is deprecated [-Wdeprecated-declarations]
                                        EmSelect (0, NULL, NULL, NULL, &tv);
                                        ^
./em.h:25:20: note: expanded from macro 'EmSelect'
  #define EmSelect rb_thread_select
                   ^
/Users/nm/.rbenv/versions/2.1.2/include/ruby-2.1.0/ruby/intern.h:440:16: note: 'rb_thread_select' declared here
DEPRECATED(int rb_thread_select(int, fd_set *, fd_set *, fd_set *, struct timeval *));
               ^
/Users/nm/.rbenv/versions/2.1.2/include/ruby-2.1.0/x86_64-darwin13.0/ruby/config.h:114:52: note: expanded from macro 'DEPRECATED'
#define DEPRECATED(x) __attribute__ ((deprecated)) x
                                                   ^
em.cpp:1109:40: error: invalid operands to binary expression ('__bind<int &, sockaddr *&, int &>' and 'int')
                if (bind (sd, bind_to, bind_to_size) < 0) {
                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~
em.cpp:1522:6: error: value of type '__bind<int &, sockaddr *&, int &>' is not contextually convertible to 'bool'
        if (bind (sd_accept, bind_here, bind_size)) {
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
em.cpp:1600:53: error: invalid operands to binary expression ('__bind<int &, sockaddr *, unsigned long>' and 'int')
        if (bind (sd, (struct sockaddr*)&sin, sizeof(sin)) != 0)
            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^  ~
em.cpp:1869:6: error: value of type '__bind<int &, sockaddr *, unsigned long>' is not contextually convertible to 'bool'
        if (bind (sd_accept, (struct sockaddr*)&s_sun, sizeof(s_sun))) {
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from em.cpp:23:
In file included from ./project.h:150:
./em.h:189:12: warning: private field 'NextHeartbeatTime' is not used [-Wunused-private-field]
                uint64_t NextHeartbeatTime;
                         ^
./em.h:221:22: warning: private field 'inotify' is not used [-Wunused-private-field]
                InotifyDescriptor *inotify; // pollable descriptor for our inotify instance
                                   ^
5 warnings and 4 errors generated.
make: *** [em.o] Error 1

make failed, exit code 2

Gem files will remain installed in /Users/nm/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/eventmachine-1.0.3 for inspection.
Results logged to /Users/nm/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/extensions/x86_64-darwin-13/2.1.0-static/eventmachine-1.0.3/gem_make.out

When I install version 1.0.1 or 1.0.2, I will get some similar errors. 当我安装1.0.1或1.0.2版本时,会出现一些类似的错误。

Someone can tell me why? 有人可以告诉我为什么吗? thanks. 谢谢。

From the docs it looks like eventmachine does not yet support Ruby 2+ 从文档看来,事件机尚不支持Ruby 2+

EventMachine supports Ruby 1.8.7, 1.9.2, REE, JRuby and works well on Windows as well as many operating systems from the Unix family (Linux, Mac OS X, BSD flavors). EventMachine支持Ruby 1.8.7、1.9.2,REE,JRuby,并且可以在Windows以及Unix系列的许多操作系统(Linux,Mac OS X,BSD版本)上良好运行。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM