Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Terminal error message when trying to install Sass

Tags:

sass

rubygems

Below is the exact message returned from terminal:

ERROR: Error installing sass: ERROR failed to build gem native extension. current directory: /Library/Ruby/Gems/2.0.0/gems/ffi-1.9.18/ext/ffi_c /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby -r ./siteconf20170721-3751-3vsh43.rb extconf.rb mkmf.rb can't find header files for ruby at /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/include/ruby.h

extconf failed, exit code 1

Gem files will remain installed in /Library/Ruby/Gems/2.0.0/gems/ffi-1.9.18 for inspection. Results logged to /Library/Ruby/Gems/2.0.0/extensions/universal-darwin-16/2.0.0/ffi-1.9.18/gem_make.out

I tried both options, including gem install sass and sudo gem install sass. @Carnaru Valentin said to try sudo apt-get install ruby2.1-dev build-essential. When I tried this, terminal returned sudo: apt-get: command not found. I am running macOS. Anyone know how to solve this issue?

like image 220
Shivang Patel Avatar asked Jul 22 '17 18:07

Shivang Patel


People also ask

How do I know if Sass is installed in CMD?

The “-v” command checks the version of SASS you have installed. If you don't have it installed, it will come back as not installed.

How do you install Sass and use it?

You can install Sass on Windows, Mac, or Linux by downloading the package for your operating system from GitHub and adding it to your PATH . That's all—there are no external dependencies and nothing else you need to install.


2 Answers

It happens because you don't have Xcode Command Line developer tool on your OSX. For Sass, Compass and NPM, you need to have Xcode on your Mac OSX.

Install it by this command: xcode-select --install. You can also install it through App Store. It usually takes time to download and Install Xcode.

After installation is finished you must use sudo xcodebuild -license command to accept Xcode License agreement. Once you accept it, you can install your Sass with sudo gem install sass command easily.

like image 155
Iman Sedighi Avatar answered Oct 21 '22 04:10

Iman Sedighi


First you should download the last version of Ruby Ruby Last Version because rubygems.org updated their SSL certificate and older versions don't have the updated certificate bundled for more information about this check this link rubygem SSL certificate

second After you install last version of Ruby , open cmd and write this command gem install sass if you have an error like this gem install sass

you must run this command chcp 65001 chcp is shortcut for Change the active console This command is rarely required as most GUI programs and PowerShell now support Unicode for more information check this link change active console page After run this command,write command of install sass again gem install sass gem install sass congratulation sass installed succussfully

like image 28
Eng_Farghly Avatar answered Oct 21 '22 04:10

Eng_Farghly