sparklemotion / nokogiri.org-tutorials

(deprecated)
39 stars 39 forks source link

Installation issue with ruby 2.6.0-rc1 #62

Closed PikachuEXE closed 5 years ago

PikachuEXE commented 5 years ago

Env

MacOS 10.13.6 (17G3025) RVM master ruby 2.6.0rc1 (2018-12-06 trunk 66253) [x86_64-darwin17] gem -v => 3.0.0.beta3

Install with system libraries works fine

Output of gem install

gem install nokogiri --no-document
Building native extensions. This could take a while...
ERROR:  Error installing nokogiri:
    ERROR: Failed to build gem native extension.

    current directory: /users/pikachuexe/.rvm/gems/ruby-2.6.0-rc1/gems/nokogiri-1.8.5/ext/nokogiri
/users/pikachuexe/.rvm/rubies/ruby-2.6.0-rc1/bin/ruby -I /users/pikachuexe/.rvm/rubies/ruby-2.6.0-rc1/lib/ruby/2.6.0 -r ./siteconf20181207-86262-xdzba5.rb extconf.rb
checking if the C compiler accepts ... yes
checking if the C compiler accepts -Wno-error=unused-command-line-argument-hard-error-in-future... no
Building nokogiri using packaged libraries.
Using mini_portile version 2.3.0
checking for iconv.h... yes
checking for gzdopen() in -lz... yes
sh: CC_WRAPPER: command not found
checking for iconv using --with-opt-* flags... yes
************************************************************************
IMPORTANT NOTICE:

Building Nokogiri with a packaged version of libxml2-2.9.8
with the following patches applied:
    - 0001-Revert-Do-not-URI-escape-in-server-side-includes.patch
    - 0002-Fix-nullptr-deref-with-XPath-logic-ops.patch
    - 0003-Fix-infinite-loop-in-LZMA-decompression.patch

Team Nokogiri will keep on doing their best to provide security
updates in a timely manner, but if this is a concern for you and want
to use the system library instead; abort this installation process and
reinstall nokogiri as follows:

    gem install nokogiri -- --use-system-libraries
        [--with-xml2-config=/path/to/xml2-config]
        [--with-xslt-config=/path/to/xslt-config]

If you are using Bundler, tell it to use the option:

    bundle config build.nokogiri --use-system-libraries
    bundle install

Note, however, that nokogiri is not fully compatible with arbitrary
versions of libxml2 provided by OS/package vendors.
************************************************************************
Extracting libxml2-2.9.8.tar.gz into tmp/x86_64-apple-darwin17.7.0/ports/libxml2/2.9.8... OK
Running git apply with /users/pikachuexe/.rvm/gems/ruby-2.6.0-rc1/gems/nokogiri-1.8.5/patches/libxml2/0001-Revert-Do-not-URI-escape-in-server-side-includes.patch... OK
Running git apply with /users/pikachuexe/.rvm/gems/ruby-2.6.0-rc1/gems/nokogiri-1.8.5/patches/libxml2/0002-Fix-nullptr-deref-with-XPath-logic-ops.patch... OK
Running git apply with /users/pikachuexe/.rvm/gems/ruby-2.6.0-rc1/gems/nokogiri-1.8.5/patches/libxml2/0003-Fix-infinite-loop-in-LZMA-decompression.patch... OK
Running 'configure' for libxml2 2.9.8... ERROR, review '/users/pikachuexe/.rvm/gems/ruby-2.6.0-rc1/gems/nokogiri-1.8.5/ext/nokogiri/tmp/x86_64-apple-darwin17.7.0/ports/libxml2/2.9.8/configure.log' to see what happened. Last lines are:
========================================================================
checking whether to enable maintainer-specific portions of Makefiles... yes
checking build system type... x86_64-apple-darwin17.7.0
checking host system type... x86_64-apple-darwin17.7.0
checking for a BSD-compatible install... /usr/local/bin/ginstall -c
checking whether build environment is sane... yes
checking for x86_64-apple-darwin17.7.0-strip... no
checking for strip... strip
checking for a thread-safe mkdir -p... /usr/local/bin/gmkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether make supports nested variables... (cached) yes
checking for x86_64-apple-darwin17.7.0-gcc... $(CC_WRAPPER) gcc
checking whether the C compiler works... no
configure: error: in `/users/pikachuexe/.rvm/gems/ruby-2.6.0-rc1/gems/nokogiri-1.8.5/ext/nokogiri/tmp/x86_64-apple-darwin17.7.0/ports/libxml2/2.9.8/libxml2-2.9.8':
configure: error: C compiler cannot create executables
See `config.log' for more details
========================================================================
*** 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/pikachuexe/.rvm/rubies/ruby-2.6.0-rc1/bin/$(RUBY_BASE_NAME)
    --help
    --clean
    --use-system-libraries
    --enable-static
    --disable-static
    --with-zlib-dir
    --without-zlib-dir
    --with-zlib-include
    --without-zlib-include=${zlib-dir}/include
    --with-zlib-lib
    --without-zlib-lib=${zlib-dir}/lib
    --enable-cross-build
    --disable-cross-build
/users/pikachuexe/.rvm/gems/ruby-2.6.0-rc1/gems/mini_portile2-2.3.0/lib/mini_portile2/mini_portile.rb:402:in `block in execute': Failed to complete configure task (RuntimeError)
    from /users/pikachuexe/.rvm/gems/ruby-2.6.0-rc1/gems/mini_portile2-2.3.0/lib/mini_portile2/mini_portile.rb:373:in `chdir'
    from /users/pikachuexe/.rvm/gems/ruby-2.6.0-rc1/gems/mini_portile2-2.3.0/lib/mini_portile2/mini_portile.rb:373:in `execute'
    from /users/pikachuexe/.rvm/gems/ruby-2.6.0-rc1/gems/mini_portile2-2.3.0/lib/mini_portile2/mini_portile.rb:110:in `configure'
    from /users/pikachuexe/.rvm/gems/ruby-2.6.0-rc1/gems/mini_portile2-2.3.0/lib/mini_portile2/mini_portile.rb:153:in `cook'
    from extconf.rb:365:in `block (2 levels) in process_recipe'
    from extconf.rb:257:in `block in chdir_for_build'
    from extconf.rb:256:in `chdir'
    from extconf.rb:256:in `chdir_for_build'
    from extconf.rb:364:in `block in process_recipe'
    from extconf.rb:262:in `tap'
    from extconf.rb:262:in `process_recipe'
    from extconf.rb:551:in `<main>'

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

  /users/pikachuexe/.rvm/gems/ruby-2.6.0-rc1/extensions/x86_64-darwin-17/2.6.0/nokogiri-1.8.5/mkmf.log

extconf failed, exit code 1

Gem files will remain installed in /users/pikachuexe/.rvm/gems/ruby-2.6.0-rc1/gems/nokogiri-1.8.5 for inspection.
Results logged to /users/pikachuexe/.rvm/gems/ruby-2.6.0-rc1/extensions/x86_64-darwin-17/2.6.0/nokogiri-1.8.5/gem_make.out

Content of /users/pikachuexe/.rvm/gems/ruby-2.6.0-rc1/extensions/x86_64-darwin-17/2.6.0/nokogiri-1.8.5/mkmf.log

cat /users/pikachuexe/.rvm/gems/ruby-2.6.0-rc1/extensions/x86_64-darwin-17/2.6.0/nokogiri-1.8.5/mkmf.log
" gcc -o conftest -I/users/pikachuexe/.rvm/rubies/ruby-2.6.0-rc1/include/ruby-2.6.0/x86_64-darwin17 -I/users/pikachuexe/.rvm/rubies/ruby-2.6.0-rc1/include/ruby-2.6.0/ruby/backward -I/users/pikachuexe/.rvm/rubies/ruby-2.6.0-rc1/include/ruby-2.6.0 -I.  -I/usr/local/opt/libyaml/include -I/usr/local/opt/readline/include -I/usr/local/opt/libksba/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  conftest.c  -L. -L/users/pikachuexe/.rvm/rubies/ruby-2.6.0-rc1/lib -L/usr/local/opt/libyaml/lib -L/usr/local/opt/readline/lib -L/usr/local/opt/libksba/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/readline/lib -L/usr/local/opt/libksba/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/pikachuexe/.rvm/rubies/ruby-2.6.0-rc1/include/ruby-2.6.0/x86_64-darwin17 -I/users/pikachuexe/.rvm/rubies/ruby-2.6.0-rc1/include/ruby-2.6.0/ruby/backward -I/users/pikachuexe/.rvm/rubies/ruby-2.6.0-rc1/include/ruby-2.6.0 -I.  -I/usr/local/opt/libyaml/include -I/usr/local/opt/readline/include -I/usr/local/opt/libksba/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    -Werror -c conftest.c"
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: int main() {return 0;}
/* end */

" gcc -I/users/pikachuexe/.rvm/rubies/ruby-2.6.0-rc1/include/ruby-2.6.0/x86_64-darwin17 -I/users/pikachuexe/.rvm/rubies/ruby-2.6.0-rc1/include/ruby-2.6.0/ruby/backward -I/users/pikachuexe/.rvm/rubies/ruby-2.6.0-rc1/include/ruby-2.6.0 -I.  -I/usr/local/opt/libyaml/include -I/usr/local/opt/readline/include -I/usr/local/opt/libksba/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  -Wno-error=unused-command-line-argument-hard-error-in-future   -Werror -c conftest.c"
error: unknown warning option '-Werror=unused-command-line-argument-hard-error-in-future'; did you mean '-Werror=unused-command-line-argument'? [-Werror,-Wunknown-warning-option]
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: int main() {return 0;}
/* end */

have_header: checking for iconv.h... -------------------- yes

" gcc -E -I/users/pikachuexe/.rvm/rubies/ruby-2.6.0-rc1/include/ruby-2.6.0/x86_64-darwin17 -I/users/pikachuexe/.rvm/rubies/ruby-2.6.0-rc1/include/ruby-2.6.0/ruby/backward -I/users/pikachuexe/.rvm/rubies/ruby-2.6.0-rc1/include/ruby-2.6.0 -I.  -I/usr/local/opt/libyaml/include -I/usr/local/opt/readline/include -I/usr/local/opt/libksba/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  -O3 -Wall -Wcast-qual -Wwrite-strings -Wmissing-noreturn -Winline  conftest.c -o conftest.i"
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: #include <iconv.h>
/* end */

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

have_library: checking for gzdopen() in -lz... -------------------- yes

" gcc -o conftest -I/users/pikachuexe/.rvm/rubies/ruby-2.6.0-rc1/include/ruby-2.6.0/x86_64-darwin17 -I/users/pikachuexe/.rvm/rubies/ruby-2.6.0-rc1/include/ruby-2.6.0/ruby/backward -I/users/pikachuexe/.rvm/rubies/ruby-2.6.0-rc1/include/ruby-2.6.0 -I.  -I/usr/local/opt/libyaml/include -I/usr/local/opt/readline/include -I/usr/local/opt/libksba/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  -O3 -Wall -Wcast-qual -Wwrite-strings -Wmissing-noreturn -Winline conftest.c  -L. -L/users/pikachuexe/.rvm/rubies/ruby-2.6.0-rc1/lib -L/usr/local/opt/libyaml/lib -L/usr/local/opt/readline/lib -L/usr/local/opt/libksba/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/readline/lib -L/usr/local/opt/libksba/lib -L/usr/local/opt/openssl@1.1/lib     -lruby.2.6 -lz    "
checked program was:
/* begin */
 1: #include "ruby.h"
 2:
 3: #include <zlib.h>
 4:
 5: /*top*/
 6: extern int t(void);
 7: int main(int argc, char **argv)
 8: {
 9:   if (argc > 1000000) {
10:     int (* volatile tp)(void)=(int (*)(void))&t;
11:     printf("%d", (*tp)());
12:   }
13:
14:   return 0;
15: }
16: int t(void) { void ((*volatile p)()); p = (void ((*)()))gzdopen; return !p; }
/* end */

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

have_iconv?: checking for iconv using --with-opt-* flags... -------------------- yes

" gcc -o conftest -I/users/pikachuexe/.rvm/rubies/ruby-2.6.0-rc1/include/ruby-2.6.0/x86_64-darwin17 -I/users/pikachuexe/.rvm/rubies/ruby-2.6.0-rc1/include/ruby-2.6.0/ruby/backward -I/users/pikachuexe/.rvm/rubies/ruby-2.6.0-rc1/include/ruby-2.6.0 -I.  -I/usr/local/opt/libyaml/include -I/usr/local/opt/readline/include -I/usr/local/opt/libksba/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  -O3 -Wall -Wcast-qual -Wwrite-strings -Wmissing-noreturn -Winline conftest.c  -L. -L/users/pikachuexe/.rvm/rubies/ruby-2.6.0-rc1/lib -L/usr/local/opt/libyaml/lib -L/usr/local/opt/readline/lib -L/usr/local/opt/libksba/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/readline/lib -L/usr/local/opt/libksba/lib -L/usr/local/opt/openssl@1.1/lib     -lruby.2.6    "
Undefined symbols for architecture x86_64:
  "_iconv", referenced from:
      _main in conftest-9ee7b6.o
  "_iconv_open", referenced from:
      _main in conftest-9ee7b6.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
checked program was:
/* begin */
 1: #include "ruby.h"
 2:
 3: #include <stdlib.h>
 4: #include <iconv.h>
 5:
 6: int main(void)
 7: {
 8:     iconv_t cd = iconv_open("", "");
 9:     iconv(cd, NULL, NULL, NULL, NULL);
10:     return EXIT_SUCCESS;
11: }
/* end */

" gcc -o conftest -I/users/pikachuexe/.rvm/rubies/ruby-2.6.0-rc1/include/ruby-2.6.0/x86_64-darwin17 -I/users/pikachuexe/.rvm/rubies/ruby-2.6.0-rc1/include/ruby-2.6.0/ruby/backward -I/users/pikachuexe/.rvm/rubies/ruby-2.6.0-rc1/include/ruby-2.6.0 -I.  -I/usr/local/opt/libyaml/include -I/usr/local/opt/readline/include -I/usr/local/opt/libksba/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  -O3 -Wall -Wcast-qual -Wwrite-strings -Wmissing-noreturn -Winline conftest.c  -L. -L/users/pikachuexe/.rvm/rubies/ruby-2.6.0-rc1/lib -L/usr/local/opt/libyaml/lib -L/usr/local/opt/readline/lib -L/usr/local/opt/libksba/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/readline/lib -L/usr/local/opt/libksba/lib -L/usr/local/opt/openssl@1.1/lib     -lruby.2.6 -liconv   "
checked program was:
/* begin */
 1: #include "ruby.h"
 2:
 3: #include <stdlib.h>
 4: #include <iconv.h>
 5:
 6: int main(void)
 7: {
 8:     iconv_t cd = iconv_open("", "");
 9:     iconv(cd, NULL, NULL, NULL, NULL);
10:     return EXIT_SUCCESS;
11: }
/* end */

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

I can find file named iconv.h at ~/.rvm/gems/ruby-2.6.0-rc1/gems/nokogiri-1.8.5/ext/nokogiri/tmp/x86_64-apple-darwin17.7.0/ports/libxml2/2.9.8/libxml2-2.9.8/os400/iconv/iconv.h with content

/**
***     Declarations for the iconv wrappers.
***
***     See Copyright for the status of this software.
***
***     Author: Patrick Monnerat <pm@datasphere.ch>, DATASPHERE S.A.
**/

#ifndef __ICONV_H_
#define __ICONV_H_

#ifdef __cplusplus
extern "C" {
#endif

#include <stddef.h>             /* For size_t. */

typedef void *  Iconv_t;

Iconv_t         IconvOpen(const char * tocode, const char * fromcode);
size_t          Iconv(Iconv_t cd, char * * inbuf, size_t * inbytesleft,
                                        char * * outbuf, size_t * outbytesleft);
int             IconvClose(Iconv_t cd);

#ifndef USE_SYSTEM_ICONV
#define iconv_t         Iconv_t
#define iconv_open      IconvOpen
#define iconv           Iconv
#define iconv_close     IconvClose
#endif

#ifdef __cplusplus
}
#endif

#endif

/cc @zenspider

flavorjones commented 5 years ago

Hi, this is a repository for documentation about nokogiri. If you're having trouble with Nokogiri, please open an issue at https://github.com/sparklemotion/nokogiri

Thank you!