在OS X 10.10.5中安装nokogiri失败

时间:2015-08-22 21:58:45

标签: ruby xcode nokogiri jekyll

我正在遵循Github的Jekyll安装说明 https://help.github.com/articles/using-jekyll-with-pages/

简单地发布build install最初无法编译libxml2-2.9.2。日志显示它与我的系统库/usr/local/lib/libiconv.dylib不是64位相关:"缺少文件/usr/local/lib/libiconv.dylib"中所需的体系结构x86_64。 p>

提供库,如

gem install nokogiri -v '1.6.6.2' -- \
--with-xml2-include=/Applications/Dev/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/usr/include/libxml2/ \
--with-iconv-include=/Applications/Dev/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/usr/include/ \
--with-iconv-lib=/Applications/Dev/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/usr/lib --use-system-libraries
在Xcode下,使用iconv解决64位问题,但系统地在找到libxml2 时失败。请参阅下面的日志。

我已尝试过Error to install Nokogiri on OSX 10.9 Maverick?我可以使用的所有选项 和 Nokogiri installation fails -libxml2 is missing 但无济于事。我还安装了fink和libmxl2,并指向那里的包含文件和库,但它在同一点也失败了。

我有Xcode 6.4的最新更新,并确保发出 xcode-select --install 。 Homebrew对我来说不是一个选择。

在我最后一次使用Xcode库&包括路径。

日志中提到的mkmf.log文件在哪里?从其他线索来看,我希望能够解决这个问题,而且我似乎已经接近了它,但经过一天处理这一切之后,我现在无法看到它。

提前感谢任何有关如何解决此问题的提示。

PS:我只是想在github中试用博客。所有这些红宝石mambo-jambo都不应该比好老的cmake,dpkg等更容易吗?我无法对这种过多的包装和流行趋势采取正确的思维方式。版本管理器每个都有自己的特质。 rbenv,gem,bunlder等的这种方法在习惯之后会变得更可靠吗?还是总是这么脆弱?只是想知道是否值得努力熟悉这一切......

PS2:安装日志,如下所示 〜/ .rbenv /版本/ 2.1.0 / LIB /红宝石/宝石/ 2.1.0 /扩展/ x86_64的-达尔文-14 / 2.1.0静电/引入nokogiri-1.6.6.2 / gem_make.out

/Users/masl/.rbenv/versions/2.1.0/bin/ruby -r ./siteconf20150822-64326-2krxl7.rb extconf.rb --with-xml2-include=/Applications/Dev/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/usr/include/libxml2/ --with-iconv-include=/Applications/Dev/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/usr/include/ --with-iconv-lib=/Applications/Dev/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/usr/lib --use-system-libraries
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 system libraries.
libxml2 version 2.9.2 or later is highly recommended, but proceeding anyway.
checking for xmlParseDoc() in libxml/parser.h... no
checking for xmlParseDoc() in -lxml2... no
checking for xmlParseDoc() in -llibxml2... no
-----
libxml2 is missing.  Please locate mkmf.log to investigate how it is failing.
-----
*** 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
    --without-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/masl/.rbenv/versions/2.1.0/bin/ruby
    --help
    --clean
    --use-system-libraries
    --with-zlib-dir
    --without-zlib-dir
    --with-zlib-include
    --without-zlib-include=${zlib-dir}/include
    --with-zlib-lib
    --without-zlib-lib=${zlib-dir}/lib
    --with-xml2-dir
    --without-xml2-dir
    --with-xml2-include=${xml2-dir}/include
    --with-xml2-lib
    --without-xml2-lib=${xml2-dir}/lib
    --with-xslt-dir
    --without-xslt-dir
    --with-xslt-include
    --without-xslt-include=${xslt-dir}/include
    --with-xslt-lib
    --without-xslt-lib=${xslt-dir}/lib
    --with-libxslt-config
    --without-libxslt-config
    --with-pkg-config
    --without-pkg-config
    --with-exslt-dir
    --without-exslt-dir
    --with-exslt-include
    --without-exslt-include=${exslt-dir}/include
    --with-exslt-lib
    --without-exslt-lib=${exslt-dir}/lib
    --with-libexslt-config
    --without-libexslt-config
    --with-xml2lib
    --without-xml2lib
    --with-libxml2lib
    --without-libxml2lib

extconf failed, exit code 1

1 个答案:

答案 0 :(得分:0)

这对我有用:

sudo gem install nokogiri -v '1.6.6.2' -- --use-system-libraries --with-xml2-include=/usr/include/libxml2 --with-xml2-lib=/usr/lib