新手问题 bundle install 时出错,求前辈指点

farsonL · 2017年01月09日 · 最后由 huacnlee 回复于 2017年01月10日 · 2574 次阅读
  • 问题

新手,github 上 clone 了一个爬虫 direct_web_spider,https://github.com/hooopo/direct_web_spider, 想慢慢研究一下,bundle install 时出现问题。 我的环境是 ubuntu16.10,ruby2.3.3,direct_web_spider 要求 ruby1.9.2+。

  • 错误信息
current directory:
/home/fan/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/eventmachine-0.12.10/ext
/home/fan/.rbenv/versions/2.3.3/bin/ruby -r ./siteconf20170109-4366-10w5t7g.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_thread_check_ints()... yes
checking for rb_time_new()... yes
checking for sys/event.h... no
checking for epoll_create() in sys/epoll.h... yes
creating Makefile

To see why this extension failed to compile, please check the mkmf.log which can
be found here:

/home/fan/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/extensions/x86_64-linux/2.3.0-static/eventmachine-0.12.10/mkmf.log

 An error occurred while installing eventmachine (0.12.10), and Bundler cannot continue.
Make sure that `gem install eventmachine -v '0.12.10'` succeeds before bundling. 

  • 部分 mkmf.log
gcc -o conftest -I/home/fan/.rbenv/versions/2.3.3/include/ruby-2.3.0/x86_64-linux -I/home/fan/.rbenv/versions/2.3.3/include/ruby-2.3.0/ruby/backward -I/home/fan/.rbenv/versions/2.3.3/include/ruby-2.3.0 -I. -I/home/fan/.rbenv/versions/2.3.3/include     -O3 -fno-fast-math -ggdb3 -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wunused-variable -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration -Wdeprecated-declarations -Wno-packed-bitfield-compat conftest.c  -L. -L/home/fan/.rbenv/versions/2.3.3/lib -Wl,-R/home/fan/.rbenv/versions/2.3.3/lib -L. -L/home/fan/.rbenv/versions/2.3.3/lib  -fstack-protector -rdynamic -Wl,-export-dynamic     -Wl,-R/home/fan/.rbenv/versions/2.3.3/lib -L/home/fan/.rbenv/versions/2.3.3/lib -lruby-static  -lpthread -ldl -lcrypt -lm   -lc"
/tmp/ccbt47Zt.o:在函数‘t’中:
/home/fan/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/eventmachine-0.12.10/ext/conftest.c:14:对‘rb_thread_blocking_region’未定义的引用
collect2: error: ld returned 1 exit status



have_header: checking for sys/event.h... -------------------- no

"gcc -E -I/home/fan/.rbenv/versions/2.3.3/include/ruby-2.3.0/x86_64-linux -I/home/fan/.rbenv/versions/2.3.3/include/ruby-2.3.0/ruby/backward -I/home/fan/.rbenv/versions/2.3.3/include/ruby-2.3.0 -I. -I/home/fan/.rbenv/versions/2.3.3/include     -O3 -fno-fast-math -ggdb3 -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wunused-variable -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration -Wdeprecated-declarations -Wno-packed-bitfield-compat  conftest.c -o conftest.i"
conftest.c:3:23: fatal error: sys/event.h: 没有那个文件或目录

Make sure that gem install eventmachine -v '0.12.10' succeeds before bundling.

没装过这个不太晓得,会不会是这个包的版本的问题?或者是是不是这个包需要系统的支持?

项目太老了,可能新的 Ruby 版本不一定能安装,你最好用它当时的 1.9.3 版本试试

需要 登录 后方可回复, 如果你还没有账号请 注册新账号