Ruby sassc - Build error on mac

cheng_sukai · 2021年01月08日 · 最后由 funggg 回复于 2021年01月08日 · 1009 次阅读

Hello guys, I'm hitting this build error and I'm not sure how to get past it. Using Ruby 2.6.4. Any ideas?

sudo gem install jekyll                                                                                   base   at 08:35:38 下午 
Password:
Building native extensions. This could take a while...
ERROR:  Error installing jekyll:
    ERROR: Failed to build gem native extension.

    current directory: /usr/local/lib/ruby/gems/2.7.0/gems/sassc-2.4.0/ext
/usr/local/opt/ruby/bin/ruby -I /usr/local/Cellar/ruby/2.7.2/lib/ruby/2.7.0 -r ./siteconf20210108-25376-1xljyak.rb extconf.rb
creating Makefile

current directory: /usr/local/lib/ruby/gems/2.7.0/gems/sassc-2.4.0/ext
make "DESTDIR=" clean

current directory: /usr/local/lib/ruby/gems/2.7.0/gems/sassc-2.4.0/ext
make "DESTDIR="
compiling ./libsass/src/ast.cpp
In file included from ./libsass/src/ast.cpp:5:
In file included from ./libsass/src/ast.hpp:9:
In file included from /Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/unordered_map:409:
In file included from /Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/__hash_table:18:
/Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/cmath:317:9: error: no member named 'signbit' in the global namespace
using ::signbit;
      ~~^
/Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/cmath:318:9: error: no member named 'fpclassify' in the global namespace
using ::fpclassify;
      ~~^
/Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/cmath:319:9: error: no member named 'isfinite' in the global namespace; did you mean 'finite'?
using ::isfinite;
      ~~^
/usr/local/include/math.h:752:12: note: 'finite' declared here
extern int finite(double)
           ^
In file included from ./libsass/src/ast.cpp:5:
In file included from ./libsass/src/ast.hpp:9:
In file included from /Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/unordered_map:409:
In file included from /Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/__hash_table:18:
/Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/cmath:320:9: error: no member named 'isinf' in the global namespace
using ::isinf;
      ~~^
/Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/cmath:321:9: error: no member named 'isnan' in the global namespace
using ::isnan;
      ~~^
/Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/cmath:322:9: error: no member named 'isnormal' in the global namespace
using ::isnormal;
      ~~^
/Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/cmath:323:7: error: no member named 'isgreater' in the global namespace; did you mean '::std::greater'?
using ::isgreater;
      ^~
/Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/functional:738:29: note: '::std::greater' declared here
struct _LIBCPP_TEMPLATE_VIS greater : binary_function<_Tp, _Tp, bool>
                            ^
In file included from ./libsass/src/ast.cpp:5:
In file included from ./libsass/src/ast.hpp:9:
In file included from /Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/unordered_map:409:
In file included from /Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/__hash_table:18:
/Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/cmath:324:7: error: no member named 'isgreaterequal' in the global namespace; did you mean '::std::greater_equal'?
using ::isgreaterequal;
      ^~
/Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/functional:767:29: note: '::std::greater_equal' declared here
struct _LIBCPP_TEMPLATE_VIS greater_equal : binary_function<_Tp, _Tp, bool>
                            ^
In file included from ./libsass/src/ast.cpp:5:
In file included from ./libsass/src/ast.hpp:9:
In file included from /Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/unordered_map:409:
In file included from /Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/__hash_table:18:
/Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/cmath:325:9: error: no member named 'isless' in the global namespace
using ::isless;
      ~~^
/Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/cmath:326:9: error: no member named 'islessequal' in the global namespace
using ::islessequal;
      ~~^
/Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/cmath:327:9: error: no member named 'islessgreater' in the global namespace
using ::islessgreater;
      ~~^
/Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/cmath:328:9: error: no member named 'isunordered' in the global namespace
using ::isunordered;
      ~~^
/Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/cmath:329:9: error: no member named 'isunordered' in the global namespace
using ::isunordered;
      ~~^
13 errors generated.
make: *** [ast.o] Error 1

make failed, exit code 2

Gem files will remain installed in /usr/local/lib/ruby/gems/2.7.0/gems/sassc-2.4.0 for inspection.
Results logged to /usr/local/lib/ruby/gems/2.7.0/extensions/x86_64-darwin-20/2.7.0/sassc-2.4.0/gem_make.out

虽然不知道怎么回事,但是我重新安装了 xcode-select 然后就好了

xcode-select --install

反正问题就是在/usr/local/include

It seems like compile error, did you install the command line tools?

code-select --install

btw, it not recommend using sudo with gem , take a look: https://github.com/jekyll/jekyll/issues/7274#issuecomment-424401726

and hope the jekyll doc can help you : https://jekyllrb.com/docs/installation/macos/

需要 登录 后方可回复, 如果你还没有账号请 注册新账号