【问题标题】:Can't build eventmachine 1.0.3 Mac OS X 10.9.2无法构建 eventmachine 1.0.3 Mac OS X 10.9.2
【发布时间】:2014-05-19 07:09:44
【问题描述】:

我想重新安装我的 ruby​​ on rails 环境,但是失败了。

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

我想跑步:

gem install eventmachine -v '1.0.3'

但我明白了:

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

当我安装版本 1.0.1 或 1.0.2 时,我会遇到一些类似的错误。

谁能告诉我为什么?谢谢。

【问题讨论】:

    标签: ruby-on-rails ruby-on-rails-4 gem


    【解决方案1】:

    从文档看来 eventmachine 还不支持 Ruby 2+

    EventMachine 支持 Ruby 1.8.7、1.9.2、REE、JRuby 并且在 Windows 以及 Unix 系列的许多操作系统(Linux、 Mac OS X,BSD 风格)。

    【讨论】:

    • 宝石薄取决于它。我在 Ruby 2 上安装了 Thin(所以 eventmachine 会自动安装)。
    猜你喜欢
    • 1970-01-01
    • 2014-06-25
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-01-05
    • 2012-12-17
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多