Problem Description:
Under the Ubuntu system, the Ruby development environment is installed first through the command sudo apt-get install Ruby, and then with the command-line gem install Jekyll install the GitHub page's development tool Jekyll, encountered an error message: Failed to build gem native extension details are as follows:
Error: Error installing Jekyll:
error:failed to build gem native extension.
Current directory:/var/lib/gems/2.3.0/gems/ffi-1.9.18/ext/ffi_c
/usr/bin/ruby2.3-r./ SITECONF20170316-3892-175H62N.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 would remain installed in/var/lib/gems/2.3.0/gems/ffi-1.9.18 for Insp Ection.
Results logged To/var/lib/gems/2.3.0/extensions/x86_64-linux/2.3.0/ffi-1.9.18/gem_make.out
Solution:
Since it's the development tool for GitHub page, it's easy to find a solution on GitHub:
This means that when you install Ruby in Ubuntu's default apt-get, you do not have Ruby-dev installed, and you need to enter sudo apt-get intall ruby-dev in terminal. Close test, problem solving.