noi4r gem安装问题

时间:2015-04-06 17:49:58

标签: ruby-on-rails ruby gem

尝试安装nio4r gem。我试过了

gem install nio4r -v '1.0.0'

弹出的错误是:

Building native extensions.  This could take a while...
ERROR:  Error installing nio4r:

ERROR: Failed to build gem native extension.

/.rvm/rubies/ruby-2.2.1/bin/ruby -r ./siteconf20150406-11564-1qtifmf.rb extconf.rb

checking for rb_thread_blocking_region()... no
checking for sys/select.h... yes
checking for poll.h... yes
checking for sys/epoll.h... no
checking for sys/event.h... yes
checking for sys/queue.h... yes
checking for port.h... no
checking for sys/resource.h... yes
creating Makefile

make "DESTDIR=" clean

make "DESTDIR="
compiling monitor.c
In file included from monitor.c:6:
In file included from ./nio4r.h:10:
/.rvm/rubies/ruby-2.2.1/include/ruby-2.2.0/ruby/backward/rubyio.h:2:2: warning: use "ruby/io.h" instead of "rubyio.h" [-W#warnings]
warning use "ruby/io.h" instead of "rubyio.h"

...

我错了什么?这是我的RVM的问题吗?

1 个答案:

答案 0 :(得分:3)

通过一些基本的更新,我能够让它发挥作用。

bundle update

然后

bundle

安装gem。

感谢https://github.com/celluloid/nio4r/issues/46

另一种方法是使用RVM安装更高版本的ruby并再次执行bundle。两者都有效