Error installing Sass

The following is the exact message returned by the terminal:

ERROR: Error installing sass: ERROR could not create native gem 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. / siteconf 20170721-3751-3vsh43.rb extconf.rb mkmf.rb cannot find the 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 be installed in / Library / Ruby / Gems / 2.0.0 / gems / ffi-1.9.18 for verification. The results are registered in / 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 installs sass. @Carnaru Valentin said to try sudo apt-get install ruby2.1-dev build-essential. When I tried this, the terminal returned sudo: apt-get: command not found. I am running macOS. Does anyone know how to solve this problem?

+5
source share
4 answers

First you have to download the latest version of Ruby Ruby Last Version , because rubygems.org updated its SSL certificate, and older versions do not have an updated certificate in the kit for more information on this, check this link rubygem SSL certificate

second After installing the latest version of Ruby, open cmd and write this command gem install sass if you have such an error gem install sass

you must run this command chcp 65001 chcp is a shortcut to change the active console. This command is rarely required because most graphics programs and PowerShell now support Unicode; for more information, check this link change the active console page After executing this command, write the install sass command again gem install sass gem install sass congratulation sass set succussfully

+2
source

This is because you do not have the Xcode Command Line developer tool on your OSX. For Sass, Compass, and NPM, you need to have Xcode on Mac OSX.

Install it using this command: xcode-select --install . You can also install it through the App Store. Usually, it takes time to download and install Xcode.

After installation is complete, you must use the sudo xcodebuild -license to accept the Xcode license agreement. After accepting it, you can easily install Sass using the sudo gem install sass .

+12
source

Do not use the Ruby 2.5.0 installer if you do not want to solve problems when installing gems! If you do not know which version to install and you start with Ruby, we recommend Ruby , you use Ruby 2.4.X as the x64 or x86 installer. They provide a stable language and the largest number of compatible gems. However, not all gems are supported. Some older packages may not be compatible with newer versions of Ruby and RubyInstaller.

Make sure "Add Ruby Executables to your PATH" is enabled during the installation process. Then try typing gem install sass. hope this helped someone.

+1
source

If you installed ruby from the distro repository, the problem may arise because you did not install the development libraries (especially ruby.h )

 sudo apt-get install ruby-dev 

or

 sudo dnf install ruby-devel 
0
source

Source: https://habr.com/ru/post/1270104/


All Articles