- Install Ruby and SQLite3
- Install Rails with gem
got below error:
1
sudo gem install rails
After try install nokogiri1
2
3
4
5
6
7
8
9
10
11ERROR: Error installing rails:
ERROR: Failed to build gem native extension.
current directory: /var/lib/gems/2.5.0/gems/nokogiri-1.10.9/ext/nokogiri
/usr/bin/ruby2.5 -r ./siteconf20200314-38-xxyy88.rb extconf.rb
checking if the C compiler accepts ... yes
Building nokogiri using packaged libraries.
Using mini_portile version 2.4.0
checking for gzdopen() in -lz... no
zlib is missing; necessary for building libxml2
*** extconf.rb failed ***Error:1
sudo gem install nokogiri
checked log and found the cause, install libz-dev and then install nokogiri1
2
3
4
5
6
7
8
9
10ERROR: Error installing nokogiri:
ERROR: Failed to build gem native extension.
current directory: /var/lib/gems/2.5.0/gems/nokogiri-1.10.9/ext/nokogiri
/usr/bin/ruby2.5 -r ./siteconf20200314-78-1wo5kzo.rb extconf.rb
checking if the C compiler accepts ... yes
Building nokogiri using packaged libraries.
Using mini_portile version 2.4.0
checking for gzdopen() in -lz... no
zlib is missing; necessary for building libxml21
2
3vim /var/lib/gems/2.5.0/extensions/x86_64-linux/2.5.0/nokogiri-1.10.9/mkmf.log
sudo apt-get install libz-dev
sudo gem install nokogiri - try install rails againCheck result with
1
sudo gem install rails
rails -v
.
It’s done.
Reference from:
Getting Started with Rails
How to fix fatal error: zlib.h: no such file or directory?