title: I got this error while trying to install rails ERROR: Failed to build gem native extension. (Ubuntu 16.04)
body: <p>My ruby version is <code>ruby 2.3.1p112 (2016-04-26) [x86_64-linux-gnu]</code>. And my gem version is 2.5.1</p>
  
  <p>I want to install rails, but when I try <code>sudo gem install rails</code>
  It gives me this error</p>
  
  <pre><code>Building native extensions.  This could take a while...
  ERROR:  Error installing rails:
  ERROR: Failed to build gem native extension.
  
  current directory: /var/lib/gems/2.3.0/gems/nokogiri-1.6.8/ext/nokogiri
  /usr/bin/ruby2.3 -r ./siteconf20160905-4032-nlscry.rb extconf.rb
  mkmf.rb cant find header files for ruby at /usr/lib/ruby/include/ruby.h
  
  extconf failed, exit code 1
  
  Gem files will remain installed in /var/lib/gems/2.3.0/gems/nokogiri-1.6.8 for inspection.
  Results logged to /var/lib/gems/2.3.0/extensions/x86_64-linux/2.3.0/nokogiri-1.6.8/gem_make.out
  </code></pre>
  
  <p>Please let me know how to solve it, thank you.</p>