title: Error Installing Rails 5.2.3 on Ubuntu 18.04
body: <p>I'm trying to install Rails 5.2.3 on Ubuntu 18.04 PC using Ruby version -2.5.5 and during the installation I'm facing this error.</p>
  
  <pre><code>$ gem install rails -v 5.2.3
  
  Building native extensions. This could take a while...
  ERROR:  Error installing rails:
      ERROR: Failed to build gem native extension.
  
      current directory: /home/amani/.rvm/gems/ruby-2.5.5/gems/nokogiri-1.10.4/ext/nokogiri
  /home/amani/.rvm/rubies/ruby-2.5.5/bin/ruby -I /home/amani/.rvm/rubies/ruby-2.5.5/lib/ruby/site_ruby/2.5.0 -r ./siteconf20190831-23754-eu6kq8.rb extconf.rb
  checking if the C compiler accepts ... *** 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 options.
  
  Provided configuration options:
      --with-opt-dir
      --without-opt-dir
      --with-opt-include
      --without-opt-include=${opt-dir}/include
      --with-opt-lib
      --without-opt-lib=${opt-dir}/lib
      --with-make-prog
      --without-make-prog
      --srcdir=.
      --curdir
      --ruby=/home/amani/.rvm/rubies/ruby-2.5.5/bin/$(RUBY_BASE_NAME)
      --help
      --clean
  /home/amani/.rvm/rubies/ruby-2.5.5/lib/ruby/2.5.0/mkmf.rb:456:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
  You have to install development tools first.
      from /home/amani/.rvm/rubies/ruby-2.5.5/lib/ruby/2.5.0/mkmf.rb:574:in `block in try_compile'
      from /home/amani/.rvm/rubies/ruby-2.5.5/lib/ruby/2.5.0/mkmf.rb:521:in `with_werror'
      from /home/amani/.rvm/rubies/ruby-2.5.5/lib/ruby/2.5.0/mkmf.rb:574:in `try_compile'
      from extconf.rb:138:in `nokogiri_try_compile'
      from extconf.rb:162:in `block in add_cflags'
      from /home/amani/.rvm/rubies/ruby-2.5.5/lib/ruby/2.5.0/mkmf.rb:632:in `with_cflags'
      from extconf.rb:161:in `add_cflags'
      from extconf.rb:416:in `&lt;main&gt;'
  </code></pre>
  
  <p>To see why this extension failed to compile, please check the mkmf.log which can be found here:</p>
  
  <pre><code>  /home/amani/.rvm/gems/ruby-2.5.5/extensions/x86_64-linux/2.5.0/nokogiri-1.10.4/mkmf.log
  
  extconf failed, exit code 1
  
  Gem files will remain installed in /home/amani/.rvm/gems/ruby-2.5.5/gems/nokogiri-1.10.4 for inspection.
  Results logged to /home/amani/.rvm/gems/ruby-2.5.5/extensions/x86_64-linux/2.5.0/nokogiri-1.10.4/gem_make.out
  </code></pre>
  
  <p>These are the error messages on terminal.</p>