rubys / nokogumbo

A Nokogiri interface to the Gumbo HTML5 parser.
Apache License 2.0
186 stars 114 forks source link

Error Install nogobumbo on MacBook Pro 14 inches M1 pro #185

Closed khunemz closed 1 year ago

khunemz commented 1 year ago

Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

current directory: /Users/chutipongroobklom/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/nokogumbo-1.5.0/ext/nokogumboc

/Users/chutipongroobklom/.rbenv/versions/2.7.2/bin/ruby -I /Users/chutipongroobklom/.rbenv/versions/2.7.2/lib/ruby/2.7.0 -r ./siteconf20221227-16244-1qetax7.rb extconf.rb --with-ldflags\=-L. -Wl,-O1 -Wl,--as-needed -fstack-protector -rdynamic -Wl,-export-dynamic checking for xmlNewDoc() in -lxml2... yes checking for nokogiri.h in /Users/chutipongroobklom/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/nokogiri-1.10.10/ext/nokogiri... yes checking for nokogiri.h in /Users/chutipongroobklom/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/nokogiri-1.10.10/ext/nokogiri... yes checking for gumbo_parse() in -lgumbo... no checking for GumboErrorType with error.h... not found checking for GumboInsertionMode with insertion_mode.h... not found checking for GumboParser with parser.h... not found checking for GumboStringBuffer with string_buffer.h... not found checking for GumboTokenType with token_type.h... not found creating Makefile

current directory: /Users/chutipongroobklom/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/nokogumbo-1.5.0/ext/nokogumboc make "DESTDIR=" clean

current directory: /Users/chutipongroobklom/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/nokogumbo-1.5.0/ext/nokogumboc make "DESTDIR=" compiling attribute.c compiling char_ref.c compiling error.c error.c:82:20: warning: cast to smaller integer type 'GumboTag' from 'void *' [-Wvoid-pointer-to-enum-cast] GumboTag tag = (GumboTag) error->tag_stack.data[i]; ^~~~~~~~~~~ 1 warning generated. compiling nokogumbo.c In file included from nokogumbo.c:31: /Users/chutipongroobklom/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/nokogiri-1.10.10/ext/nokogiri/nokogiri.h:13:9: warning: '_GNU_SOURCE' macro redefined [-Wmacro-redefined]

define _GNU_SOURCE

    ^

/Users/chutipongroobklom/.rbenv/versions/2.7.2/include/ruby-2.7.0/x86_64-darwin22/ruby/config.h:16:9: note: previous definition is here

define _GNU_SOURCE 1

    ^

nokogumbo.c:266:26: warning: '(' and '{' tokens introducing statement expression appear in different macro expansion contexts [-Wcompound-token-split-by-macro] rb_funcall(rb_mKernel, rb_intern("gem"), 1, rb_str_new2("nokogiri")); ^~~~ /Users/chutipongroobklom/.rbenv/versions/2.7.2/include/ruby-2.7.0/ruby/ruby.h:1847:23: note: expanded from macro 'rb_intern' extension (RUBY_CONST_ID_CACHE((ID), (str))) : \ ^ nokogumbo.c:266:26: note: '{' token is here rb_funcall(rb_mKernel, rb_intern("gem"), 1, rb_str_new2("nokogiri")); ^~~~ /Users/chutipongroobklom/.rbenv/versions/2.7.2/include/ruby-2.7.0/ruby/ruby.h:1847:24: note: expanded from macro 'rb_intern' extension (RUBY_CONST_ID_CACHE((ID), (str))) : \ ^~~~~~~~ /Users/chutipongroobklom/.rbenv/versions/2.7.2/include/ruby-2.7.0/ruby/ruby.h:1832:5: note: expanded from macro 'RUBY_CONST_ID_CACHE' { \ ^ nokogumbo.c:266:26: warning: '}' and ')' tokens terminating statement expression appear in different macro expansion contexts [-Wcompound-token-split-by-macro] rb_funcall(rb_mKernel, rb_intern("gem"), 1, rb_str_new2("nokogiri")); ^~~~ /Users/chutipongroobklom/.rbenv/versions/2.7.2/include/ruby-2.7.0/ruby/ruby.h:1847:24: note: expanded from macro 'rb_intern' extension (RUBY_CONST_ID_CACHE((ID), (str))) : \ ^~~~~~~~ /Users/chutipongroobklom/.rbenv/versions/2.7.2/include/ruby-2.7.0/ruby/ruby.h:1837:5: note: expanded from macro 'RUBY_CONST_ID_CACHE' } ^ nokogumbo.c:266:26: note: ')' token is here rb_funcall(rb_mKernel, rb_intern("gem"), 1, rb_str_new2("nokogiri")); ^~~~ /Users/chutipongroobklom/.rbenv/versions/2.7.2/include/ruby-2.7.0/ruby/ruby.h:1847:56: note: expanded from macro 'rb_intern' extension (RUBY_CONST_ID_CACHE((ID), (str))) : \ ^ nokogumbo.c:270:45: warning: '(' and '{' tokens introducing statement expression appear in different macro expansion contexts [-Wcompound-token-split-by-macro] VALUE Nokogiri = rb_const_get(rb_cObject, rb_intern("Nokogiri")); ^~~~~ /Users/chutipongroobklom/.rbenv/versions/2.7.2/include/ruby-2.7.0/ruby/ruby.h:1847:23: note: expanded from macro 'rb_intern' extension (RUBY_CONST_ID_CACHE((ID), (str))) : \ ^ nokogumbo.c:270:45: note: '{' token is here VALUE Nokogiri = rb_const_get(rb_cObject, rb_intern("Nokogiri")); ^~~~~ /Users/chutipongroobklom/.rbenv/versions/2.7.2/include/ruby-2.7.0/ruby/ruby.h:1847:24: note: expanded from macro 'rb_intern' extension (RUBY_CONST_ID_CACHE((ID), (str))) : \ ^~~~~~~~ /Users/chutipongroobklom/.rbenv/versions/2.7.2/include/ruby-2.7.0/ruby/ruby.h:1832:5: note: expanded from macro 'RUBY_CONST_ID_CACHE' { \ ^ nokogumbo.c:270:45: warning: '}' and ')' tokens terminating statement expression appear in different macro expansion contexts [-Wcompound-token-split-by-macro] VALUE Nokogiri = rb_const_get(rb_cObject, rb_intern("Nokogiri")); ^~~~~ /Users/chutipongroobklom/.rbenv/versions/2.7.2/include/ruby-2.7.0/ruby/ruby.h:1847:24: note: expanded from macro 'rb_intern' extension (RUBY_CONST_ID_CACHE((ID), (str))) : \ ^~~~~~~~ /Users/chutipongroobklom/.rbenv/versions/2.7.2/include/ruby-2.7.0/ruby/ruby.h:1837:5: note: expanded from macro 'RUBY_CONST_ID_CACHE' } ^ nokogumbo.c:270:45: note: ')' token is here VALUE Nokogiri = rb_const_get(rb_cObject, rb_intern("Nokogiri")); ^~~~~ /Users/chutipongroobklom/.rbenv/versions/2.7.2/include/ruby-2.7.0/ruby/ruby.h:1847:56: note: expanded from macro 'rb_intern' extension (RUBY_CONST_ID_CACHE((ID), (str))) : \ ^ nokogumbo.c:271:39: warning: '(' and '{' tokens introducing statement expression appear in different macro expansion contexts [-Wcompound-token-split-by-macro] VALUE HTML = rb_const_get(Nokogiri, rb_intern("HTML")); ^~~~~ /Users/chutipongroobklom/.rbenv/versions/2.7.2/include/ruby-2.7.0/ruby/ruby.h:1847:23: note: expanded from macro 'rb_intern' extension (RUBY_CONST_ID_CACHE((ID), (str))) : \ ^ nokogumbo.c:271:39: note: '{' token is here VALUE HTML = rb_const_get(Nokogiri, rb_intern("HTML")); ^~~~~ /Users/chutipongroobklom/.rbenv/versions/2.7.2/include/ruby-2.7.0/ruby/ruby.h:1847:24: note: expanded from macro 'rb_intern' extension (RUBY_CONST_ID_CACHE((ID), (str))) : \ ^~~~~~~~ /Users/chutipongroobklom/.rbenv/versions/2.7.2/include/ruby-2.7.0/ruby/ruby.h:1832:5: note: expanded from macro 'RUBY_CONST_ID_CACHE' { \ ^ nokogumbo.c:271:39: warning: '}' and ')' tokens terminating statement expression appear in different macro expansion contexts [-Wcompound-token-split-by-macro] VALUE HTML = rb_const_get(Nokogiri, rb_intern("HTML")); ^~~~~ /Users/chutipongroobklom/.rbenv/versions/2.7.2/include/ruby-2.7.0/ruby/ruby.h:1847:24: note: expanded from macro 'rb_intern' extension (RUBY_CONST_ID_CACHE((ID), (str))) : \ ^~~~~~~~ /Users/chutipongroobklom/.rbenv/versions/2.7.2/include/ruby-2.7.0/ruby/ruby.h:1837:5: note: expanded from macro 'RUBY_CONST_ID_CACHE' } ^ nokogumbo.c:271:39: note: ')' token is here VALUE HTML = rb_const_get(Nokogiri, rb_intern("HTML")); ^~~~~ /Users/chutipongroobklom/.rbenv/versions/2.7.2/include/ruby-2.7.0/ruby/ruby.h:1847:56: note: expanded from macro 'rb_intern' extension (RUBY_CONST_ID_CACHE((ID), (str))) : \ ^ nokogumbo.c:272:33: warning: '(' and '{' tokens introducing statement expression appear in different macro expansion contexts [-Wcompound-token-split-by-macro] Document = rb_const_get(HTML, rb_intern("Document")); ^~~~~ /Users/chutipongroobklom/.rbenv/versions/2.7.2/include/ruby-2.7.0/ruby/ruby.h:1847:23: note: expanded from macro 'rb_intern' extension (RUBY_CONST_ID_CACHE((ID), (str))) : \ ^ nokogumbo.c:272:33: note: '{' token is here Document = rb_const_get(HTML, rb_intern("Document")); ^~~~~ /Users/chutipongroobklom/.rbenv/versions/2.7.2/include/ruby-2.7.0/ruby/ruby.h:1847:24: note: expanded from macro 'rb_intern' extension (RUBY_CONST_ID_CACHE((ID), (str))) : \ ^~~~~~~~ /Users/chutipongroobklom/.rbenv/versions/2.7.2/include/ruby-2.7.0/ruby/ruby.h:1832:5: note: expanded from macro 'RUBY_CONST_ID_CACHE' { \ ^ nokogumbo.c:272:33: warning: '}' and ')' tokens terminating statement expression appear in different macro expansion contexts [-Wcompound-token-split-by-macro] Document = rb_const_get(HTML, rb_intern("Document")); ^~~~~ /Users/chutipongroobklom/.rbenv/versions/2.7.2/include/ruby-2.7.0/ruby/ruby.h:1847:24: note: expanded from macro 'rb_intern' extension (RUBY_CONST_ID_CACHE((ID), (str))) : \ ^~~~~~~~ /Users/chutipongroobklom/.rbenv/versions/2.7.2/include/ruby-2.7.0/ruby/ruby.h:1837:5: note: expanded from macro 'RUBY_CONST_ID_CACHE' } ^ nokogumbo.c:272:33: note: ')' token is here Document = rb_const_get(HTML, rb_intern("Document")); ^~~~~ /Users/chutipongroobklom/.rbenv/versions/2.7.2/include/ruby-2.7.0/ruby/ruby.h:1847:56: note: expanded from macro 'rb_intern' extension (RUBY_CONST_ID_CACHE((ID), (str))) : \ ^ nokogumbo.c:273:38: warning: '(' and '{' tokens introducing statement expression appear in different macro expansion contexts [-Wcompound-token-split-by-macro] VALUE XML = rb_const_get(Nokogiri, rb_intern("XML")); ^~~~ /Users/chutipongroobklom/.rbenv/versions/2.7.2/include/ruby-2.7.0/ruby/ruby.h:1847:23: note: expanded from macro 'rb_intern' extension (RUBY_CONST_ID_CACHE((ID), (str))) : \ ^ nokogumbo.c:273:38: note: '{' token is here VALUE XML = rb_const_get(Nokogiri, rb_intern("XML")); ^~~~ /Users/chutipongroobklom/.rbenv/versions/2.7.2/include/ruby-2.7.0/ruby/ruby.h:1847:24: note: expanded from macro 'rb_intern' extension (RUBY_CONST_ID_CACHE((ID), (str))) : \ ^~~~~~~~ /Users/chutipongroobklom/.rbenv/versions/2.7.2/include/ruby-2.7.0/ruby/ruby.h:1832:5: note: expanded from macro 'RUBY_CONST_ID_CACHE' { \ ^ nokogumbo.c:273:38: warning: '}' and ')' tokens terminating statement expression appear in different macro expansion contexts [-Wcompound-token-split-by-macro] VALUE XML = rb_const_get(Nokogiri, rb_intern("XML")); ^~~~ /Users/chutipongroobklom/.rbenv/versions/2.7.2/include/ruby-2.7.0/ruby/ruby.h:1847:24: note: expanded from macro 'rb_intern' extension (RUBY_CONST_ID_CACHE((ID), (str))) : \ ^~~~~~~~ /Users/chutipongroobklom/.rbenv/versions/2.7.2/include/ruby-2.7.0/ruby/ruby.h:1837:5: note: expanded from macro 'RUBY_CONST_ID_CACHE' } ^ nokogumbo.c:273:38: note: ')' token is here VALUE XML = rb_const_get(Nokogiri, rb_intern("XML")); ^~~~ /Users/chutipongroobklom/.rbenv/versions/2.7.2/include/ruby-2.7.0/ruby/ruby.h:1847:56: note: expanded from macro 'rb_intern' extension (RUBY_CONST_ID_CACHE((ID), (str))) : \ ^ nokogumbo.c:274:38: warning: '(' and '{' tokens introducing statement expression appear in different macro expansion contexts [-Wcompound-token-split-by-macro] XMLSyntaxError = rb_const_get(XML, rb_intern("SyntaxError")); ^~~~~~~~ /Users/chutipongroobklom/.rbenv/versions/2.7.2/include/ruby-2.7.0/ruby/ruby.h:1847:23: note: expanded from macro 'rb_intern' extension (RUBY_CONST_ID_CACHE((ID), (str))) : \ ^ nokogumbo.c:274:38: note: '{' token is here XMLSyntaxError = rb_const_get(XML, rb_intern("SyntaxError")); ^~~~~~~~ /Users/chutipongroobklom/.rbenv/versions/2.7.2/include/ruby-2.7.0/ruby/ruby.h:1847:24: note: expanded from macro 'rb_intern' extension (RUBY_CONST_ID_CACHE((ID), (str))) : \ ^~~~~~~~ /Users/chutipongroobklom/.rbenv/versions/2.7.2/include/ruby-2.7.0/ruby/ruby.h:1832:5: note: expanded from macro 'RUBY_CONST_ID_CACHE' { \ ^ nokogumbo.c:274:38: warning: '}' and ')' tokens terminating statement expression appear in different macro expansion contexts [-Wcompound-token-split-by-macro] XMLSyntaxError = rb_const_get(XML, rb_intern("SyntaxError")); ^~~~~~~~ /Users/chutipongroobklom/.rbenv/versions/2.7.2/include/ruby-2.7.0/ruby/ruby.h:1847:24: note: expanded from macro 'rb_intern' extension (RUBY_CONST_ID_CACHE((ID), (str))) : \ ^~~~~~~~ /Users/chutipongroobklom/.rbenv/versions/2.7.2/include/ruby-2.7.0/ruby/ruby.h:1837:5: note: expanded from macro 'RUBY_CONST_ID_CACHE' } ^ nokogumbo.c:274:38: note: ')' token is here XMLSyntaxError = rb_const_get(XML, rb_intern("SyntaxError")); ^~~~~~~~ /Users/chutipongroobklom/.rbenv/versions/2.7.2/include/ruby-2.7.0/ruby/ruby.h:1847:56: note: expanded from macro 'rb_intern' extension (RUBY_CONST_ID_CACHE((ID), (str))) : \ ^ 13 warnings generated. compiling parser.c parser.c:744:10: warning: cast to smaller integer type 'GumboInsertionMode' from 'void *' [-Wvoid-pointer-to-enum-cast] return (GumboInsertionMode) ^~~~~~~~ 1 warning generated. compiling string_buffer.c compiling string_piece.c compiling tag.c compiling tokenizer.c compiling utf8.c compiling util.c compiling vector.c linking shared-object nokogumboc.bundle Undefined symbols for architecture x86_64: "_Nokogiri_wrap_xml_document", referenced from: _parse in nokogumbo.o ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation) make: *** [nokogumboc.bundle] Error 1

make failed, exit code 2

Gem files will remain installed in /Users/chutipongroobklom/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/nokogumbo-1.5.0 for inspection. Results logged to /Users/chutipongroobklom/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/extensions/x86_64-darwin-22/2.7.0/nokogumbo-1.5.0/gem_make.out

An error occurred while installing nokogumbo (1.5.0), and Bundler cannot continue. Make sure that gem install nokogumbo -v '1.5.0' --source 'https://rubygems.org/' succeeds before bundling.

In Gemfile: locomotivecms_wagon was resolved to 3.0.5, which depends on locomotivecms_steam was resolved to 1.5.3, which depends on sanitize was resolved to 4.6.6, which depends on nokogumbo

flavorjones commented 1 year ago

Hi, Nokogumbo is no longer maintained as a separate gem, it has been merged into Nokogiri: https://github.com/rubys/nokogumbo#notice-end-of-life

Please upgrade to Nokogiri >= 1.12 and remove your explicit dependency on Nokogumbo.