<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <title>farsonL (梁法成)</title>
    <link>https://ruby-china.org/farsonL</link>
    <description/>
    <language>en-us</language>
    <item>
      <title>bundle install 时出错，求前辈指点</title>
      <description>&lt;ul&gt;
&lt;li&gt;问题&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;新手，github 上 clone 了一个爬虫 direct_web_spider，&lt;a href="https://github.com/hooopo/direct_web_spider" rel="nofollow" target="_blank" title=""&gt;https://github.com/hooopo/direct_web_spider&lt;/a&gt;,
想慢慢研究一下，bundle install 时出现问题。
&lt;strong&gt;我的环境是 ubuntu16.10，ruby2.3.3，direct_web_spider 要求 ruby1.9.2+。&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;错误信息&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;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

&lt;/code&gt;&lt;/pre&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt; 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. 

&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;部分 mkmf.log&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;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: 没有那个文件或目录
&lt;/code&gt;&lt;/pre&gt;</description>
      <author>farsonL</author>
      <pubDate>Mon, 09 Jan 2017 20:10:03 +0800</pubDate>
      <link>https://ruby-china.org/topics/32084</link>
      <guid>https://ruby-china.org/topics/32084</guid>
    </item>
  </channel>
</rss>
