title: Installing Ruby - Failed to build gem native extension
body: <p>I don't know anything about the stuff that you write here :) I tried to search for answers online, as I usually do, but unfortunately, couldn't find anything specific.</p>
  
  <p>I am trying to install Ruby on Rails, according to a description from here <a href="https://www.railstutorial.org/book/beginning" rel="nofollow noreferrer">Rails Tutorial</a> </p>
  
  <p>I have installed Bash on Ubuntu on Windows. Could you tell me what have I done wrong? Or how can I fix it to install it properly?</p>
  
  <p>when I check ruby version it shows me:</p>
  
  <pre><code>ruby 2.3.1p112 (2016-04-26) [x86-64-linux-gnu]
  </code></pre>
  
  <p>However an error appears:</p>
  
  <pre><code>ERROR: Failed to build gem native extension.
  
  current directory: /var/lib/gems/2.3.0./gems/nio4r-2.1.0/ext/nio4r/usr/bin/ruby2.3 -r ./siteconf20170726-93-g151dm.rb extconf.rb
  mkmf.rb can't 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/nio4r-2.1.0 for inspection.
  Results logged to /var/lib/gems/2.3.0/extensions/x86_64-linux/2.3.0/nio4r-2.1.0/gem_make.out
  </code></pre>
  
  <p>I have also done:</p>
  
  <pre><code>apt-get install make
  apt-get install ruby-dev
  </code></pre>
  
  <p>And now something different appeared:</p>
  
  <pre><code>    ERROR: Failed to build gem native extension.
  
      current directory: /var/lib/gems/2.3.0./gems/nio4r-2.1.0/ext/nio4r/usr/bin/ruby2.3 -r ./siteconf20170726-530-13b2fuh.rb extconf.rb
  checking for unistd.h...***extconf.rb failed ***
  
  Could not create Makefile due to some reason, probably lack of necessary libraries and/or headers. Check the mkmf.log file for more details. You may need configuration option.
  </code></pre>
  
  <p>The rest of the code can be found in the file - too much things to write by hand. :) <a href="https://i.stack.imgur.com/p6Xob.jpg" rel="nofollow noreferrer">Ruby 2- command line pict</a></p>
  
  <p>Please help!! I want to learn Ruby :) :) </p>
  
  <p>Plus, is there a way to copy command line and to paste it somehow or do I have to put it here letter by letter? :) </p>