<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <title>mamian (asdsaferwfvre)</title>
    <link>https://ruby-china.org/mamian</link>
    <description></description>
    <language>en-us</language>
    <item>
      <title>安装 Rails 失败，多次尝试未果</title>
      <description>&lt;p&gt;当我输入&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;→ &lt;span class="nb"&gt;sudo &lt;/span&gt;gem &lt;span class="nb"&gt;install &lt;/span&gt;rails
&lt;/code&gt;&lt;/pre&gt;&lt;pre class="highlight shell"&gt;&lt;code&gt;
Building native extensions.  This could take a &lt;span class="k"&gt;while&lt;/span&gt;...
ERROR:  Error installing rails:
    ERROR: Failed to build gem native extension.

    /usr/local/opt/ruby/bin/ruby &lt;span class="nt"&gt;-r&lt;/span&gt; ./siteconf20161130-77662-u8g67w.rb extconf.rb
checking &lt;span class="k"&gt;if &lt;/span&gt;the C compiler accepts ... &lt;span class="nb"&gt;yes
&lt;/span&gt;checking &lt;span class="k"&gt;if &lt;/span&gt;the C compiler accepts &lt;span class="nt"&gt;-Wno-error&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;unused-command-line-argument-hard-error-in-future... no
Building nokogiri using packaged libraries.
&lt;span class="k"&gt;***&lt;/span&gt; extconf.rb failed &lt;span class="k"&gt;***&lt;/span&gt;
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers.  Check the mkmf.log file &lt;span class="k"&gt;for &lt;/span&gt;more details.  You may
need configuration options.

Provided configuration options:
    &lt;span class="nt"&gt;--with-opt-dir&lt;/span&gt;
    &lt;span class="nt"&gt;--with-opt-include&lt;/span&gt;
    &lt;span class="nt"&gt;--without-opt-include&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="k"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;opt&lt;/span&gt;&lt;span class="p"&gt;-dir&lt;/span&gt;&lt;span class="k"&gt;}&lt;/span&gt;/include
    &lt;span class="nt"&gt;--with-opt-lib&lt;/span&gt;
    &lt;span class="nt"&gt;--without-opt-lib&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="k"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;opt&lt;/span&gt;&lt;span class="p"&gt;-dir&lt;/span&gt;&lt;span class="k"&gt;}&lt;/span&gt;/lib
    &lt;span class="nt"&gt;--with-make-prog&lt;/span&gt;
    &lt;span class="nt"&gt;--without-make-prog&lt;/span&gt;
    &lt;span class="nt"&gt;--srcdir&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nb"&gt;.&lt;/span&gt;
    &lt;span class="nt"&gt;--curdir&lt;/span&gt;
    &lt;span class="nt"&gt;--ruby&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;/usr/local/Cellar/ruby/2.3.1_2/bin/&lt;span class="si"&gt;$(&lt;/span&gt;RUBY_BASE_NAME&lt;span class="si"&gt;)&lt;/span&gt;
    &lt;span class="nt"&gt;--help&lt;/span&gt;
    &lt;span class="nt"&gt;--clean&lt;/span&gt;
    &lt;span class="nt"&gt;--use-system-libraries&lt;/span&gt;
/usr/local/lib/ruby/site_ruby/2.3.0/rubygems/dependency.rb:308:in &lt;span class="sb"&gt;`&lt;/span&gt;to_specs&lt;span class="s1"&gt;': Could not find '&lt;/span&gt;mini_portile2&lt;span class="s1"&gt;' (~&amp;gt; 2.1.0) among 6 total gem(s) (Gem::MissingSpecError)
Checked in '&lt;/span&gt;&lt;span class="nv"&gt;GEM_PATH&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;/Users/MAMIAN/.gem/ruby/2.3.0:/usr/local/lib/ruby/gems/2.3.0:/usr/local/Cellar/ruby/2.3.1_2/lib/ruby/gems/2.3.0&lt;span class="s1"&gt;', execute `gem env` for more information
    from /usr/local/lib/ruby/site_ruby/2.3.0/rubygems/dependency.rb:320:in `to_spec'&lt;/span&gt;
    from /usr/local/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_gem.rb:65:in &lt;span class="sb"&gt;`&lt;/span&gt;gem&lt;span class="s1"&gt;'
    from extconf.rb:468:in `&amp;lt;main&amp;gt;'&lt;/span&gt;

extconf failed, &lt;span class="nb"&gt;exit &lt;/span&gt;code 1

Gem files will remain installed &lt;span class="k"&gt;in&lt;/span&gt; /usr/local/lib/ruby/gems/2.2.0/gems/nokogiri-1.6.8.1 &lt;span class="k"&gt;for &lt;/span&gt;inspection.
Results logged to /usr/local/lib/ruby/gems/2.2.0/extensions/x86_64-darwin-15/2.2.0/nokogiri-1.6.8.1/gem_make.out

&lt;/code&gt;&lt;/pre&gt;&lt;pre class="highlight shell"&gt;&lt;code&gt;ruby 2.2.3p173 &lt;span class="o"&gt;(&lt;/span&gt;2015-08-18 revision 51636&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;[&lt;/span&gt;x86_64-darwin15]
rvm 1.27.0 &lt;span class="o"&gt;(&lt;/span&gt;latest&lt;span class="o"&gt;)&lt;/span&gt; by Wayne E. Seguin wayneeseguin@gmail.com, Michal Papis mpapis@gmail.com &lt;span class="o"&gt;[&lt;/span&gt;https://rvm.io/]
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Google 查了查，上面的方法都试了，还是不行，特地来问下&lt;/p&gt;

&lt;p&gt;macOS 10.12 &lt;/p&gt;

&lt;p&gt;已经解决了，利用 rvm 安装了 ruby 解决&lt;/p&gt;</description>
      <author>mamian</author>
      <pubDate>Wed, 30 Nov 2016 09:38:23 +0800</pubDate>
      <link>https://ruby-china.org/topics/31739</link>
      <guid>https://ruby-china.org/topics/31739</guid>
    </item>
  </channel>
</rss>
