Failed to Build Gem Native Extension (Installing Compass)

Ruby Compass ERROR: Failed to build gem native extension

mkmf.rb can't find header files for ruby at

You need the ruby dev headers files to compile gems.

You need the package ruby2.1-dev.

You may also need other packages like build-essential.

Try the following:

sudo apt-get install ruby2.1-dev build-essential

On earlier versions of Ubuntu such as 14.04, you will need the ruby2.0-dev package instead.

sudo apt-get install ruby2.0-dev build-essential

Error installing compass. Failed to build gem native extension (Compass)

I had faced the same issues, after going through the following Link, i have installed the Xcode and my issues is resolved.

Try to install Xcode or apple developer tools.

Failed to build gem native extension when installing bcrypt-ruby gem

I had to add a flag when installing:

gem install bcrypt-ruby -v '3.0.1' -- --with-cflags=-Wno-implicit-function-declaration

This installed the gem successfully with Ruby 2.7.2

Related Topics

Leave a reply