Skip to content

Instantly share code, notes, and snippets.

@dgoldie
Last active August 29, 2015 14:08
Show Gist options
  • Save dgoldie/397ceab48da3eeab1d06 to your computer and use it in GitHub Desktop.
Save dgoldie/397ceab48da3eeab1d06 to your computer and use it in GitHub Desktop.
installing nokogiri on Yosemite
2.1.4 apollo:~
$ cat /Users/doug/.rvm/gems/ruby-2.1.4/gems/nokogiri-1.6.3.1/ext/nokogiri/tmp/x86_64-apple-darwin14.0.0/ports/libxml2/2.8.0/configure.log
configure: WARNING: if you wanted to set the --build type, don't use --host.
If a cross compiler is detected then cross compile mode will be used
configure: error: cannot find sources (entities.c) in /Users/doug/code/libraries/ctags or ..
2.1.4 apollo:~
2.1.4 apollo:~
$ cat /Users/doug/.rvm/gems/ruby-2.1.4/extensions/x86_64-darwin-14/2.1.0/nokogiri-1.6.3.1/mkmf.log
have_header: checking for iconv.h... -------------------- yes
"gcc -o conftest -I/Users/doug/.rvm/rubies/ruby-2.1.4/include/ruby-2.1.0/x86_64-darwin14.0 -I/Users/doug/.rvm/rubies/ruby-2.1.4/include/ruby-2.1.0/ruby/backward -I/Users/doug/.rvm/rubies/ruby-2.1.4/include/ruby-2.1.0 -I. -I/usr/include -I/usr/local/opt/libyaml/include -I/usr/local/opt/readline/include -I/usr/local/opt/libksba/include -I/usr/local/opt/openssl/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -O3 -fno-fast-math -ggdb3 -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wunused-variable -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wshorten-64-to-32 -Wimplicit-function-declaration -Wdivision-by-zero -Wextra-tokens -fno-common -pipe -O3 -Wall -Wcast-qual -Wwrite-strings -Wconversion -Wmissing-noreturn -Winline conftest.c -L. -L/Users/doug/.rvm/rubies/ruby-2.1.4/lib -L/usr/lib -L/usr/local/opt/libyaml/lib -L/usr/local/opt/readline/lib -L/usr/local/opt/libksba/lib -L/usr/local/opt/openssl/lib -L. -fstack-protector -L/usr/local/opt/libyaml/lib -L/usr/local/opt/readline/lib -L/usr/local/opt/libksba/lib -L/usr/local/opt/openssl/lib -lruby.2.1.0 -lpthread -lgmp -ldl -lobjc "
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: int main(int argc, char **argv)
4: {
5: return 0;
6: }
/* end */
"gcc -E -I/Users/doug/.rvm/rubies/ruby-2.1.4/include/ruby-2.1.0/x86_64-darwin14.0 -I/Users/doug/.rvm/rubies/ruby-2.1.4/include/ruby-2.1.0/ruby/backward -I/Users/doug/.rvm/rubies/ruby-2.1.4/include/ruby-2.1.0 -I. -I/usr/include -I/usr/local/opt/libyaml/include -I/usr/local/opt/readline/include -I/usr/local/opt/libksba/include -I/usr/local/opt/openssl/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -O3 -fno-fast-math -ggdb3 -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wunused-variable -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wshorten-64-to-32 -Wimplicit-function-declaration -Wdivision-by-zero -Wextra-tokens -fno-common -pipe -O3 -Wall -Wcast-qual -Wwrite-strings -Wconversion -Wmissing-noreturn -Winline conftest.c -o conftest.i"
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: #include <iconv.h>
/* end */
--------------------
have_func: checking for iconv_open() in iconv.h... -------------------- no
"gcc -o conftest -I/Users/doug/.rvm/rubies/ruby-2.1.4/include/ruby-2.1.0/x86_64-darwin14.0 -I/Users/doug/.rvm/rubies/ruby-2.1.4/include/ruby-2.1.0/ruby/backward -I/Users/doug/.rvm/rubies/ruby-2.1.4/include/ruby-2.1.0 -I. -I/usr/include -I/usr/local/opt/libyaml/include -I/usr/local/opt/readline/include -I/usr/local/opt/libksba/include -I/usr/local/opt/openssl/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -O3 -fno-fast-math -ggdb3 -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wunused-variable -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wshorten-64-to-32 -Wimplicit-function-declaration -Wdivision-by-zero -Wextra-tokens -fno-common -pipe -O3 -Wall -Wcast-qual -Wwrite-strings -Wconversion -Wmissing-noreturn -Winline conftest.c -L. -L/Users/doug/.rvm/rubies/ruby-2.1.4/lib -L/usr/lib -L/usr/local/opt/libyaml/lib -L/usr/local/opt/readline/lib -L/usr/local/opt/libksba/lib -L/usr/local/opt/openssl/lib -L. -fstack-protector -L/usr/local/opt/libyaml/lib -L/usr/local/opt/readline/lib -L/usr/local/opt/libksba/lib -L/usr/local/opt/openssl/lib -lruby.2.1.0 -lpthread -lgmp -ldl -lobjc "
Undefined symbols for architecture x86_64:
"_iconv_open", referenced from:
_t in conftest-8874bc.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 <iconv.h>
4:
5: /*top*/
6: extern int t(void);
7: int main(int argc, char **argv)
8: {
9: if (argc > 1000000) {
10: printf("%p", &t);
11: }
12:
13: return 0;
14: }
15: int t(void) { void ((*volatile p)()); p = (void ((*)()))iconv_open; return 0; }
/* end */
"gcc -o conftest -I/Users/doug/.rvm/rubies/ruby-2.1.4/include/ruby-2.1.0/x86_64-darwin14.0 -I/Users/doug/.rvm/rubies/ruby-2.1.4/include/ruby-2.1.0/ruby/backward -I/Users/doug/.rvm/rubies/ruby-2.1.4/include/ruby-2.1.0 -I. -I/usr/include -I/usr/local/opt/libyaml/include -I/usr/local/opt/readline/include -I/usr/local/opt/libksba/include -I/usr/local/opt/openssl/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -O3 -fno-fast-math -ggdb3 -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wunused-variable -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wshorten-64-to-32 -Wimplicit-function-declaration -Wdivision-by-zero -Wextra-tokens -fno-common -pipe -O3 -Wall -Wcast-qual -Wwrite-strings -Wconversion -Wmissing-noreturn -Winline conftest.c -L. -L/Users/doug/.rvm/rubies/ruby-2.1.4/lib -L/usr/lib -L/usr/local/opt/libyaml/lib -L/usr/local/opt/readline/lib -L/usr/local/opt/libksba/lib -L/usr/local/opt/openssl/lib -L. -fstack-protector -L/usr/local/opt/libyaml/lib -L/usr/local/opt/readline/lib -L/usr/local/opt/libksba/lib -L/usr/local/opt/openssl/lib -lruby.2.1.0 -lpthread -lgmp -ldl -lobjc "
conftest.c:15:26: error: too few arguments to function call, expected 2, have 0
int t(void) { iconv_open(); return 0; }
~~~~~~~~~~ ^
/usr/include/iconv.h:62:1: note: 'iconv_open' declared here
iconv_t iconv_open (const char* /*tocode*/, const char* /*fromcode*/);
^
1 error generated.
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: #include <iconv.h>
4:
5: /*top*/
6: extern int t(void);
7: int main(int argc, char **argv)
8: {
9: if (argc > 1000000) {
10: printf("%p", &t);
11: }
12:
13: return 0;
14: }
15: int t(void) { iconv_open(); return 0; }
/* end */
--------------------
have_library: checking for iconv_open() in -liconv... -------------------- yes
"gcc -o conftest -I/Users/doug/.rvm/rubies/ruby-2.1.4/include/ruby-2.1.0/x86_64-darwin14.0 -I/Users/doug/.rvm/rubies/ruby-2.1.4/include/ruby-2.1.0/ruby/backward -I/Users/doug/.rvm/rubies/ruby-2.1.4/include/ruby-2.1.0 -I. -I/usr/include -I/usr/local/opt/libyaml/include -I/usr/local/opt/readline/include -I/usr/local/opt/libksba/include -I/usr/local/opt/openssl/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -O3 -fno-fast-math -ggdb3 -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wunused-variable -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wshorten-64-to-32 -Wimplicit-function-declaration -Wdivision-by-zero -Wextra-tokens -fno-common -pipe -O3 -Wall -Wcast-qual -Wwrite-strings -Wconversion -Wmissing-noreturn -Winline conftest.c -L. -L/Users/doug/.rvm/rubies/ruby-2.1.4/lib -L/usr/lib -L/usr/local/opt/libyaml/lib -L/usr/local/opt/readline/lib -L/usr/local/opt/libksba/lib -L/usr/local/opt/openssl/lib -L. -fstack-protector -L/usr/local/opt/libyaml/lib -L/usr/local/opt/readline/lib -L/usr/local/opt/libksba/lib -L/usr/local/opt/openssl/lib -lruby.2.1.0 -liconv -lpthread -lgmp -ldl -lobjc "
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: #include <iconv.h>
4:
5: /*top*/
6: extern int t(void);
7: int main(int argc, char **argv)
8: {
9: if (argc > 1000000) {
10: printf("%p", &t);
11: }
12:
13: return 0;
14: }
15: int t(void) { void ((*volatile p)()); p = (void ((*)()))iconv_open; return 0; }
/* end */
--------------------
2.1.4 apollo:~
$
$ !528
gem install nokogiri -- --with-xslt-dir=/usr/local/opt/libxslt --with-iconv-dir=/usr/local/opt/libiconv --with-xml2-config=/usr/local/opt/libxml2/bin/xml2-config --with-xslt-config=/usr/local/opt/libxslt/bin/xslt-config
Building native extensions with: '--with-xslt-dir=/usr/local/opt/libxslt --with-iconv-dir=/usr/local/opt/libiconv --with-xml2-config=/usr/local/opt/libxml2/bin/xml2-config --with-xslt-config=/usr/local/opt/libxslt/bin/xslt-config'
This could take a while...
Building nokogiri using packaged libraries.
Building libxml2-2.8.0 for nokogiri with the following patches applied:
- 0001-Fix-parser-local-buffers-size-problems.patch
- 0002-Fix-entities-local-buffers-size-problems.patch
- 0003-Fix-an-error-in-previous-commit.patch
- 0004-Fix-potential-out-of-bound-access.patch
- 0005-Detect-excessive-entities-expansion-upon-replacement.patch
- 0006-Do-not-fetch-external-parsed-entities.patch
- 0007-Enforce-XML_PARSER_EOF-state-handling-through-the-pa.patch
- 0008-Improve-handling-of-xmlStopParser.patch
- 0009-Fix-a-couple-of-return-without-value.patch
- 0010-Keep-non-significant-blanks-node-in-HTML-parser.patch
- 0011-Do-not-fetch-external-parameter-entities.patch
************************************************************************
IMPORTANT! Nokogiri builds and uses a packaged version of libxml2.
If this is a concern for you and you want to use the system library
instead, abort this installation process and reinstall nokogiri as
follows:
gem install nokogiri -- --use-system-libraries
If you are using Bundler, tell it to use the option:
bundle config build.nokogiri --use-system-libraries
bundle install
However, note that nokogiri does not necessarily support all versions
of libxml2.
For example, libxml2-2.9.0 and higher are currently known to be broken
and thus unsupported by nokogiri, due to compatibility problems and
XPath optimization bugs.
************************************************************************
ERROR: Error installing nokogiri:
ERROR: Failed to build gem native extension.
/Users/doug/.rvm/rubies/ruby-2.1.4/bin/ruby -r ./siteconf20141030-79595-phqjiz.rb extconf.rb --with-xslt-dir=/usr/local/opt/libxslt --with-iconv-dir=/usr/local/opt/libiconv --with-xml2-config=/usr/local/opt/libxml2/bin/xml2-config --with-xslt-config=/usr/local/opt/libxslt/bin/xslt-config
Building nokogiri using packaged libraries.
checking for iconv.h... yes
checking for iconv_open() in iconv.h... no
checking for iconv_open() in -liconv... yes
Building libxml2-2.8.0 for nokogiri with the following patches applied:
- 0001-Fix-parser-local-buffers-size-problems.patch
- 0002-Fix-entities-local-buffers-size-problems.patch
- 0003-Fix-an-error-in-previous-commit.patch
- 0004-Fix-potential-out-of-bound-access.patch
- 0005-Detect-excessive-entities-expansion-upon-replacement.patch
- 0006-Do-not-fetch-external-parsed-entities.patch
- 0007-Enforce-XML_PARSER_EOF-state-handling-through-the-pa.patch
- 0008-Improve-handling-of-xmlStopParser.patch
- 0009-Fix-a-couple-of-return-without-value.patch
- 0010-Keep-non-significant-blanks-node-in-HTML-parser.patch
- 0011-Do-not-fetch-external-parameter-entities.patch
************************************************************************
IMPORTANT! Nokogiri builds and uses a packaged version of libxml2.
If this is a concern for you and you want to use the system library
instead, abort this installation process and reinstall nokogiri as
follows:
gem install nokogiri -- --use-system-libraries
If you are using Bundler, tell it to use the option:
bundle config build.nokogiri --use-system-libraries
bundle install
However, note that nokogiri does not necessarily support all versions
of libxml2.
For example, libxml2-2.9.0 and higher are currently known to be broken
and thus unsupported by nokogiri, due to compatibility problems and
XPath optimization bugs.
************************************************************************
Extracting libxml2-2.8.0.tar.gz into tmp/x86_64-apple-darwin14.0.0/ports/libxml2/2.8.0... OK
Running patch with /Users/doug/.rvm/gems/ruby-2.1.4/gems/nokogiri-1.6.3.1/ports/patches/libxml2/0001-Fix-parser-local-buffers-size-problems.patch...
Running 'patch' for libxml2 2.8.0... OK
Running patch with /Users/doug/.rvm/gems/ruby-2.1.4/gems/nokogiri-1.6.3.1/ports/patches/libxml2/0002-Fix-entities-local-buffers-size-problems.patch...
Running 'patch' for libxml2 2.8.0... OK
Running patch with /Users/doug/.rvm/gems/ruby-2.1.4/gems/nokogiri-1.6.3.1/ports/patches/libxml2/0003-Fix-an-error-in-previous-commit.patch...
Running 'patch' for libxml2 2.8.0... OK
Running patch with /Users/doug/.rvm/gems/ruby-2.1.4/gems/nokogiri-1.6.3.1/ports/patches/libxml2/0004-Fix-potential-out-of-bound-access.patch...
Running 'patch' for libxml2 2.8.0... OK
Running patch with /Users/doug/.rvm/gems/ruby-2.1.4/gems/nokogiri-1.6.3.1/ports/patches/libxml2/0005-Detect-excessive-entities-expansion-upon-replacement.patch...
Running 'patch' for libxml2 2.8.0... OK
Running patch with /Users/doug/.rvm/gems/ruby-2.1.4/gems/nokogiri-1.6.3.1/ports/patches/libxml2/0006-Do-not-fetch-external-parsed-entities.patch...
Running 'patch' for libxml2 2.8.0... OK
Running patch with /Users/doug/.rvm/gems/ruby-2.1.4/gems/nokogiri-1.6.3.1/ports/patches/libxml2/0007-Enforce-XML_PARSER_EOF-state-handling-through-the-pa.patch...
Running 'patch' for libxml2 2.8.0... OK
Running patch with /Users/doug/.rvm/gems/ruby-2.1.4/gems/nokogiri-1.6.3.1/ports/patches/libxml2/0008-Improve-handling-of-xmlStopParser.patch...
Running 'patch' for libxml2 2.8.0... OK
Running patch with /Users/doug/.rvm/gems/ruby-2.1.4/gems/nokogiri-1.6.3.1/ports/patches/libxml2/0009-Fix-a-couple-of-return-without-value.patch...
Running 'patch' for libxml2 2.8.0... OK
Running patch with /Users/doug/.rvm/gems/ruby-2.1.4/gems/nokogiri-1.6.3.1/ports/patches/libxml2/0010-Keep-non-significant-blanks-node-in-HTML-parser.patch...
Running 'patch' for libxml2 2.8.0... OK
Running patch with /Users/doug/.rvm/gems/ruby-2.1.4/gems/nokogiri-1.6.3.1/ports/patches/libxml2/0011-Do-not-fetch-external-parameter-entities.patch...
Running 'patch' for libxml2 2.8.0... OK
Running 'configure' for libxml2 2.8.0... ERROR, review '/Users/doug/.rvm/gems/ruby-2.1.4/gems/nokogiri-1.6.3.1/ext/nokogiri/tmp/x86_64-apple-darwin14.0.0/ports/libxml2/2.8.0/configure.log' to see what happened.
*** 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/doug/.rvm/rubies/ruby-2.1.4/bin/ruby
--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/doug/.rvm/gems/ruby-2.1.4/gems/mini_portile-0.6.1/lib/mini_portile.rb:279:in `block in execute': Failed to complete configure task (RuntimeError)
from /Users/doug/.rvm/gems/ruby-2.1.4/gems/mini_portile-0.6.1/lib/mini_portile.rb:271:in `chdir'
from /Users/doug/.rvm/gems/ruby-2.1.4/gems/mini_portile-0.6.1/lib/mini_portile.rb:271:in `execute'
from /Users/doug/.rvm/gems/ruby-2.1.4/gems/mini_portile-0.6.1/lib/mini_portile.rb:66:in `configure'
from /Users/doug/.rvm/gems/ruby-2.1.4/gems/mini_portile-0.6.1/lib/mini_portile.rb:109:in `cook'
from extconf.rb:253:in `block in process_recipe'
from extconf.rb:154:in `tap'
from extconf.rb:154:in `process_recipe'
from extconf.rb:423:in `<main>'
extconf failed, exit code 1
Gem files will remain installed in /Users/doug/.rvm/gems/ruby-2.1.4/gems/nokogiri-1.6.3.1 for inspection.
Results logged to /Users/doug/.rvm/gems/ruby-2.1.4/extensions/x86_64-darwin-14/2.1.0/nokogiri-1.6.3.1/gem_make.out
2.1.4 apollo:/Users
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment