2021年1月18日星期一

sudo gem instal sass giving me this error: ERROR: Failed to build gem native extension

I am trying to install Sass using sudo gem install sass on my Mac terminal. It gives me this error:

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

current directory: /Library/Ruby/Gems/2.6.0/gems/ffi-1.14.2/ext/ffi_c  

/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby -I /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0 -r ./siteconf20210118-51317-14a8oi4.rb extconf.rb *** extconf.rb failed *** Could not create Makefile due to some reason, probably lack of necessary libraries and/or headers. Check the mkmf.log file for more details. You may need configuration options.

Provided configuration options: --with-opt-dir --without-opt-dir --with-opt-include --without-opt-include=${opt-dir}/include --with-opt-lib --without-opt-lib=${opt-dir}/lib --with-make-prog --without-make-prog --srcdir=. --curdir --ruby=/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/$(RUBY_BASE_NAME) --with-ffi_c-dir --without-ffi_c-dir --with-ffi_c-include --without-ffi_c-include=${ffi_c-dir}/include --with-ffi_c-lib --without-ffi_c-lib=${ffi_c-dir}/lib --enable-system-libffi --disable-system-libffi --with-libffi-config --without-libffi-config --with-pkg-config --without-pkg-config /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:467:in try_do': The compiler failed to generate an executable file. (RuntimeError) You have to install development tools first. from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:546:in block in try_link0'

For reference, my operating system is macOS Catalina version 10.15.7 and I have ruby 2.6.3p62. I have tried sudo apt install ruby-dev before trying to again, and it gives me this message:

Unable to locate an executable at "/Library/Java/JavaVirtualMachines/jdk-15.0.1.jdk/Contents/Home/bin/apt" (-1).

I have also tried installing with brew and I already have command line tools installed. What should I do?

https://stackoverflow.com/questions/65784175/sudo-gem-instal-sass-giving-me-this-error-error-failed-to-build-gem-native-ext January 19, 2021 at 09:06AM

没有评论:

发表评论