我想在rails环境中重新安装我的ruby,但它失败了。
我在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时,我会遇到类似的错误。
有人可以告诉我为什么?感谢。
答案 0 :(得分:0)
从文档来看,eventmachine似乎还不支持Ruby 2 +
EventMachine支持Ruby 1.8.7,1.9.2,REE,JRuby并且运行良好 Windows以及Unix系列中的许多操作系统(Linux, Mac OS X,BSD风格)。