ruby - Rails 中的事件机错误

标签 ruby ruby-on-rails-3

在更新我的 Rails 应用程序包时,它显示以下错误:

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

    /home/mspd/.rvm/rubies/ruby-2.2.0/bin/ruby -r ./siteconf20150105-24447-rayukd.rb extconf.rb 
checking for rb_trap_immediate in ruby.h,rubysig.h... no
checking for rb_thread_blocking_region()... no
checking for inotify_init() in sys/inotify.h... yes
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... no
checking for epoll_create() in sys/epoll.h... yes
creating Makefile

make "DESTDIR=" clean

make "DESTDIR="
compiling em.cpp
em.cpp: In member function ‘void EventMachine_t::_RunEpollOnce()’:
em.cpp:574:37: error: ‘rb_thread_select’ was not declared in this scope
   EmSelect (0, NULL, NULL, NULL, &tv);
                                     ^
em.cpp: In member function ‘int SelectData_t::_Select()’:
em.cpp:827:67: error: ‘rb_thread_select’ was not declared in this scope
  return EmSelect (maxsocket+1, &fdreads, &fdwrites, &fderrors, &tv);
                                                                   ^
em.cpp: In member function ‘void EventMachine_t::_RunSelectOnce()’:
em.cpp:946:40: error: ‘rb_thread_select’ was not declared in this scope
      EmSelect (0, NULL, NULL, NULL, &tv);
                                        ^
make: *** [em.o] Error 1

make failed, exit code 2

Gem files will remain installed in /home/mspd/.rvm/gems/ruby-2.2.0/gems/eventmachine-1.0.3 for inspection.
Results logged to /home/mspd/.rvm/gems/ruby-2.2.0/extensions/x86-linux/2.2.0/eventmachine-1.0.3/gem_make.out
An error occurred while installing eventmachine (1.0.3), and Bundler cannot continue.
Make sure that `gem install eventmachine -v '1.0.3'` succeeds before bundling.

当我尝试gem install eventmachine时,它仍然显示相同的错误。

我应该做什么?

最佳答案

我不是 EventMachine 维护者,但 EventMachine 可能永远不会支持 Ruby 2.2.0,因为他们只接受安全补丁,但不主动接受功能 PR。

他们也在公开场合提到了这一点README :

What platforms are supported by EventMachine?

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).

解决方案:回退到 Ruby 1.9.2 或使用 EventMachine 的替代方案.

关于ruby - Rails 中的事件机错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27781424/

相关文章:

ruby-on-rails - 如何为初始化变量创建验证?

ruby-on-rails - 如何使用 Capistrano gem 为生产数据库播种?

ruby-on-rails - 带有isolate_namespace但在表上没有前缀命名空间的Rails可挂载引擎

ruby - 如何使用 View 和创建日期以及点赞数对对象进行排名?

ruby-on-rails - 我需要知道什么才能为 Rails 做贡献?

ruby - 在 Ruby 中递归地展平数组

ruby-on-rails - 对货币对象执行数学运算时出现问题 - "Unknown Method "Exchange_to"for 0 :fixnum"[Rails 4] [Money Gem]

ruby-on-rails - 在 Rails 中选择不同的 PostgreSQL 错误

ruby-on-rails - 在嵌套资源中创建新项目的问题

ruby - 循环 ruby 的简单计数器