Building native extensions.
This is 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.8.2/ext/nokogiri/usr/bin/ruby2.3-r./ SITECONF20180213-11055-1AANQYP.RB extconf.rb Checking if the C compiler accepts ... yes building Nokogiri using packaged L
Ibraries. Using mini_portile version 2.3.0 checking for Gzdopen () In-lz ... no zlib is missing; necessary for building LIBXML2 * * EXTCONF.RB failed * * Could not create Makefile due to some reason, probably lack of NE Cessary libraries and/or headers. Check the Mkmf.log file for more details.
Your 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=/usr/bin/$ (ruby_base_name) 2.3--help--clean--use-system-libraries--enable-static--disable-static--with-zlib-dir--wit Hout-zlib-dir--with-zlib-include--without-zlib-include=${zlib-dir}/include--with-zlib-lib--without-zli B-lib=${zlib-dir}/lib--enable-cross-build--disable-cross-build to the why this extension failed to compile, ple ASE Check the Mkmf.log which can be found here:/VAR/LIB/GEMS/2.3.0/EXTENSIONS/X86_64-LINUX/2.3.0/NOKOGIRI-1.8.2/MKMF.L OG extconf failed, exit code 1 GEM files would remain installed in/var/lib/gems/2.3.0/gems/nokogiri-1.8.2 for inspection
.
Results logged To/var/lib/gems/2.3.0/extensions/x86_64-linux/2.3.0/nokogiri-1.8.2/gem_make.out
Then found rails did not install up, see an article in watercress, so common sense installation zlib
$sudo apt-get Install zlib1g
$sudo apt-get Install Zlib1g.dev
Then you install rails and you succeed.
PS: If there is any problem when installing zlib, you can go to see the article of watercress.