<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <title>flamen (重楼)</title>
    <link>https://ruby-china.org/flamen</link>
    <description/>
    <language>en-us</language>
    <item>
      <title>编译 ruby 时 “failed to compile script probes.d: Preprocessor not found” 的解决办法</title>
      <description>&lt;p&gt;今天升级 ruby 时 报错（mac 下）：
Apple LLVM version 5.1 (clang-503.0.40) (based on LLVM 3.4svn)
Target: x86_64-apple-darwin13.2.0
Thread model: posix
compiling miniprelude.c
translating probes probes.d
compiling bignum.c
compiling class.c
compiling compar.c
dtrace: failed to compile script probes.d: Preprocessor not found
make: *** [probes.h] Error 1
make: *** Waiting for unfinished jobs....&lt;/p&gt;

&lt;p&gt;错误原因：ruby(2.1.0 2.1.1 2.1.2) 默认打开了 dtrace 选项，1.9.3 无影响&lt;/p&gt;

&lt;p&gt;dtrace 选项介绍：
The dtrace command is a generic front-end to the DTrace facility.  The command implements a simple interface to invoke the D language compiler, the ability to retrieve buffered trace data from the DTrace kernel facility, and a set of basic routines to format and print traced data.  Due  to  the  kernel facility it uses to operate, the dtrace command requires root privileges.&lt;/p&gt;

&lt;p&gt;看来是 for D 语言的，貌似用不到，关闭之&lt;/p&gt;

&lt;p&gt;rbenv 的同学可以用：&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;CONFIGURE_OPTS&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;'--disable-dtrace'&lt;/span&gt;
rbenv &lt;span class="nb"&gt;install &lt;/span&gt;2.1.2
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;直接编译的同学可以用：&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;./configure &lt;span class="nt"&gt;--disable-dtrace&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;google 了半天，有人遇到过但是 reinstall 了 xcode 或 reboot 解决掉，见版友也有人碰到过此问题：&lt;a href="https://ruby-china.org/topics/17485" rel="nofollow" target="_blank"&gt;https://ruby-china.org/topics/17485&lt;/a&gt; 均不适用于我 -_-&lt;/p&gt;

&lt;p&gt;贴在这里 希望对碰到类似问题的版友有所帮助&lt;/p&gt;</description>
      <author>flamen</author>
      <pubDate>Thu, 05 Jun 2014 08:32:39 +0800</pubDate>
      <link>https://ruby-china.org/topics/19748</link>
      <guid>https://ruby-china.org/topics/19748</guid>
    </item>
  </channel>
</rss>
