Failed to build gem native extension encountered while installing sass

error message

sudo gem install sass encountered the following error message

Building native extensions. This could take a while...
ERROR:  Error installing sass:
    ERROR: Failed to build gem native extension.

    current directory: /var/lib/gems/2.5.0/gems/ffi-1.11.1/ext/ffi_c
/usr/bin/ruby2.5 -r ./siteconf20190522-24821-9c6o4.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.5.0/gems/ffi-1.11.1 for inspection.
Results logged to /var/lib/gems/2.5.0/extensions/x86_64-linux/2.5.0/ffi-1.11.1/gem_make.out


looked at some of the solutions on the web, and finally solved by installing the full ruby.

: sudo apt install ruby

use the command sudo apt install ruby-full to install ruby, and then use the command sudo gem install sass to successfully install sass.


Replace the gem with the installation source

gem sources --remove

gem source -a

gem sources -l


Read More: