rubys / nokogumbo

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

Mac Catalina nd Ubuntu 18.04 installation error #177

Closed staycreativedesign closed 3 years ago

staycreativedesign commented 3 years ago
RUBY VERSION
   ruby 2.6.3p62

BUNDLED WITH
   2.2.16

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

    current directory: /Users/pdgcreative/.rvm/gems/ruby-2.6.3@neca/gems/nokogumbo-2.0.5/ext/nokogumbo
/Users/pdgcreative/.rvm/rubies/ruby-2.6.3/bin/ruby -I /Users/pdgcreative/.rvm/rubies/ruby-2.6.3/lib/ruby/site_ruby/2.6.0 -r ./siteconf20210506-7674-1q285xn.rb extconf.rb
checking for whether -I/Users/pdgcreative/.rvm/gems/ruby-2.6.3@neca/gems/nokogiri-1.11.1-x86_64-darwin/ext/nokogiri is accepted as CFLAGS... yes
checking for whether -I/Users/pdgcreative/.rvm/gems/ruby-2.6.3@neca/gems/nokogiri-1.11.1-x86_64-darwin/ext/nokogiri/include is accepted as CFLAGS... yes
checking for whether -I/Users/pdgcreative/.rvm/gems/ruby-2.6.3@neca/gems/nokogiri-1.11.1-x86_64-darwin/ext/nokogiri/include/libxml2 is accepted as CFLAGS... yes
*** 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
    --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=/Users/pdgcreative/.rvm/rubies/ruby-2.6.3/bin/$(RUBY_BASE_NAME)
    --with-libxml2
    --without-libxml2
extconf.rb:78:in `<main>': undefined method `empty?' for nil:NilClass (NoMethodError)

To see why this extension failed to compile, please check the mkmf.log which can be found here:

  /Users/pdgcreative/.rvm/gems/ruby-2.6.3@neca/extensions/x86_64-darwin-18/2.6.0/nokogumbo-2.0.5/mkmf.log

extconf failed, exit code 1

Gem files will remain installed in /Users/pdgcreative/.rvm/gems/ruby-2.6.3@neca/gems/nokogumbo-2.0.5 for inspection.
Results logged to /Users/pdgcreative/.rvm/gems/ruby-2.6.3@neca/extensions/x86_64-darwin-18/2.6.0/nokogumbo-2.0.5/gem_make.out

Here is the mkmf.log


block in append_cflags: checking for whether -I/Users/pdgcreative/.rvm/gems/ruby-2.6.3@neca/gems/nokogiri-1.11.1-x86_64-darwin/ext/nokogiri is accepted as CFLAGS... -------------------- yes

"gcc -o conftest -I/Users/pdgcreative/.rvm/rubies/ruby-2.6.3/include/ruby-2.6.0/x86_64-darwin18 -I/Users/pdgcreative/.rvm/rubies/ruby-2.6.3/include/ruby-2.6.0/ruby/backward -I/Users/pdgcreative/.rvm/rubies/ruby-2.6.3/include/ruby-2.6.0 -I.  -I/usr/local/opt/libyaml/include -I/usr/local/opt/libksba/include -I/usr/local/opt/readline/include -I/usr/local/opt/zlib/include -I/usr/local/opt/openssl@1.1/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT   -O3 -ggdb3 -Wall -Wextra -Wdeclaration-after-statement -Wdeprecated-declarations -Wdivision-by-zero -Wimplicit-function-declaration -Wimplicit-int -Wpointer-arith -Wshorten-64-to-32 -Wwrite-strings -Wmissing-noreturn -Wno-constant-logical-operand -Wno-long-long -Wno-missing-field-initializers -Wno-overlength-strings -Wno-parentheses-equality -Wno-self-assign -Wno-tautological-compare -Wno-unused-parameter -Wno-unused-value -Wunused-variable -Wextra-tokens  -fno-common -pipe -std=c99 conftest.c  -L. -L/Users/pdgcreative/.rvm/rubies/ruby-2.6.3/lib -L/usr/local/opt/libyaml/lib -L/usr/local/opt/libksba/lib -L/usr/local/opt/readline/lib -L/usr/local/opt/zlib/lib -L/usr/local/opt/openssl@1.1/lib -L. -fstack-protector-strong -L/usr/local/lib -L/usr/local/opt/libyaml/lib -L/usr/local/opt/libksba/lib -L/usr/local/opt/readline/lib -L/usr/local/opt/zlib/lib -L/usr/local/opt/openssl@1.1/lib     -lruby.2.6   "
checked program was:
/* begin */
1: #include "ruby.h"
2: 
3: int main(int argc, char **argv)
4: {
5:   return 0;
6: }
/* end */

"gcc -I/Users/pdgcreative/.rvm/rubies/ruby-2.6.3/include/ruby-2.6.0/x86_64-darwin18 -I/Users/pdgcreative/.rvm/rubies/ruby-2.6.3/include/ruby-2.6.0/ruby/backward -I/Users/pdgcreative/.rvm/rubies/ruby-2.6.3/include/ruby-2.6.0 -I.  -I/usr/local/opt/libyaml/include -I/usr/local/opt/libksba/include -I/usr/local/opt/readline/include -I/usr/local/opt/zlib/include -I/usr/local/opt/openssl@1.1/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT   -O3 -ggdb3 -Wall -Wextra -Wdeclaration-after-statement -Wdeprecated-declarations -Wdivision-by-zero -Wimplicit-function-declaration -Wimplicit-int -Wpointer-arith -Wshorten-64-to-32 -Wwrite-strings -Wmissing-noreturn -Wno-constant-logical-operand -Wno-long-long -Wno-missing-field-initializers -Wno-overlength-strings -Wno-parentheses-equality -Wno-self-assign -Wno-tautological-compare -Wno-unused-parameter -Wno-unused-value -Wunused-variable -Wextra-tokens  -fno-common -pipe -std=c99  -I/Users/pdgcreative/.rvm/gems/ruby-2.6.3@neca/gems/nokogiri-1.11.1-x86_64-darwin/ext/nokogiri -Werror -c conftest.c"
checked program was:
/* begin */
1: #include "ruby.h"
2: 
3: int main(int argc, char **argv)
4: {
5:   return 0;
6: }
/* end */

--------------------

block in append_cflags: checking for whether -I/Users/pdgcreative/.rvm/gems/ruby-2.6.3@neca/gems/nokogiri-1.11.1-x86_64-darwin/ext/nokogiri/include is accepted as CFLAGS... -------------------- yes

"gcc -I/Users/pdgcreative/.rvm/rubies/ruby-2.6.3/include/ruby-2.6.0/x86_64-darwin18 -I/Users/pdgcreative/.rvm/rubies/ruby-2.6.3/include/ruby-2.6.0/ruby/backward -I/Users/pdgcreative/.rvm/rubies/ruby-2.6.3/include/ruby-2.6.0 -I.  -I/usr/local/opt/libyaml/include -I/usr/local/opt/libksba/include -I/usr/local/opt/readline/include -I/usr/local/opt/zlib/include -I/usr/local/opt/openssl@1.1/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT   -O3 -ggdb3 -Wall -Wextra -Wdeclaration-after-statement -Wdeprecated-declarations -Wdivision-by-zero -Wimplicit-function-declaration -Wimplicit-int -Wpointer-arith -Wshorten-64-to-32 -Wwrite-strings -Wmissing-noreturn -Wno-constant-logical-operand -Wno-long-long -Wno-missing-field-initializers -Wno-overlength-strings -Wno-parentheses-equality -Wno-self-assign -Wno-tautological-compare -Wno-unused-parameter -Wno-unused-value -Wunused-variable -Wextra-tokens  -fno-common -pipe -std=c99 -I/Users/pdgcreative/.rvm/gems/ruby-2.6.3@neca/gems/nokogiri-1.11.1-x86_64-darwin/ext/nokogiri  -I/Users/pdgcreative/.rvm/gems/ruby-2.6.3@neca/gems/nokogiri-1.11.1-x86_64-darwin/ext/nokogiri/include -Werror -c conftest.c"
checked program was:
/* begin */
1: #include "ruby.h"
2: 
3: int main(int argc, char **argv)
4: {
5:   return 0;
6: }
/* end */

--------------------

block in append_cflags: checking for whether -I/Users/pdgcreative/.rvm/gems/ruby-2.6.3@neca/gems/nokogiri-1.11.1-x86_64-darwin/ext/nokogiri/include/libxml2 is accepted as CFLAGS... -------------------- yes

"gcc -I/Users/pdgcreative/.rvm/rubies/ruby-2.6.3/include/ruby-2.6.0/x86_64-darwin18 -I/Users/pdgcreative/.rvm/rubies/ruby-2.6.3/include/ruby-2.6.0/ruby/backward -I/Users/pdgcreative/.rvm/rubies/ruby-2.6.3/include/ruby-2.6.0 -I.  -I/usr/local/opt/libyaml/include -I/usr/local/opt/libksba/include -I/usr/local/opt/readline/include -I/usr/local/opt/zlib/include -I/usr/local/opt/openssl@1.1/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT   -O3 -ggdb3 -Wall -Wextra -Wdeclaration-after-statement -Wdeprecated-declarations -Wdivision-by-zero -Wimplicit-function-declaration -Wimplicit-int -Wpointer-arith -Wshorten-64-to-32 -Wwrite-strings -Wmissing-noreturn -Wno-constant-logical-operand -Wno-long-long -Wno-missing-field-initializers -Wno-overlength-strings -Wno-parentheses-equality -Wno-self-assign -Wno-tautological-compare -Wno-unused-parameter -Wno-unused-value -Wunused-variable -Wextra-tokens  -fno-common -pipe -std=c99 -I/Users/pdgcreative/.rvm/gems/ruby-2.6.3@neca/gems/nokogiri-1.11.1-x86_64-darwin/ext/nokogiri -I/Users/pdgcreative/.rvm/gems/ruby-2.6.3@neca/gems/nokogiri-1.11.1-x86_64-darwin/ext/nokogiri/include  -I/Users/pdgcreative/.rvm/gems/ruby-2.6.3@neca/gems/nokogiri-1.11.1-x86_64-darwin/ext/nokogiri/include/libxml2 -Werror -c conftest.c"
checked program was:
/* begin */
1: #include "ruby.h"
2: 
3: int main(int argc, char **argv)
4: {
5:   return 0;
6: }
/* end */

--------------------

What am I missing here, these both errors are happening. 
staycreativedesign commented 3 years ago

Actually I followed the instructions and I've installed it on a mac but on a server I keep on getting

extconf.rb:78:in `<main>': undefined method `empty?' for nil:NilClass

when installing it using rvm 2.6.3

stevecheckoway commented 3 years ago

It looks like Nokogiri is failing to build. Can you try installing Nokogiri first following the instructions here?

Otherwise, @flavorjones might have an idea.

flavorjones commented 3 years ago

@staycreativedesign Sorry about this, I introduced a bug into Nokogumbo's extension build script in v2.0.5 that breaks in this way with Nokogiri v1.11.0 and v1.11.1.

As a workaround, if you upgrade to Nokogiri v1.11.2 or later, or if you downgrade Nokogumbo to a version < v2.0.5, you should be fine.

@stevecheckoway this is the line in extconf.rb that is checking for ldflags. If you like I can fix it and we can make another Nokogumbo release. Or, we can just wait another week or two and ship the merged version of Nokogiri v1.12. WDYT?

staycreativedesign commented 3 years ago

Upgraded Nokogiri :)

stevecheckoway commented 3 years ago

@flavorjones With the view of doing less work, I suggest waiting and shipping the merged version.

flavorjones commented 3 years ago

@staycreativedesign Thanks for your patience, and thanks for closing the loop.

@stevecheckoway Roger that.

Closing this issue.