在 mac (libxml2) 上安装 nokogiri 1.6.0 时出错 [英] Error installing nokogiri 1.6.0 on mac (libxml2)

查看:18
本文介绍了在 mac (libxml2) 上安装 nokogiri 1.6.0 时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

更新:已修复

我在另一个帖子中找到了答案.我使用的解决方法是告诉 Nokogiri 改用系统库:

I found the answer in another thread. The workaround I used is to tell Nokogiri to use the system libraries instead:

NOKOGIRI_USE_SYSTEM_LIBRARIES=1 bundle install

====

尝试在 Mac 上安装 nokogiri 1.6.0.使用以前的版本,我没有问题.但是 1.6.0 拒绝安装.这是错误:

Trying to install nokogiri 1.6.0 on a mac. With previous versions, I had no problems. But 1.6.0 refuses to install. This is the error:

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

    /Users/josenriq/.rvm/rubies/ruby-1.9.3-head/bin/ruby extconf.rb
Extracting libxml2-2.8.0.tar.gz into tmp/i686-apple-darwin11/ports/libxml2/2.8.0... ERROR
tar: This does not look like a tar archive
tar: Skipping to next header
tar: Archive contains obsolescent base-64 headers
tar: Read 3 bytes from /Users/josenriq/.rvm/gems/ruby-1.9.3-head@wdi/gems/nokogiri-1.6.0/ports/archives/libxml2-2.8.0.tar.gz
tar: Error exit delayed from previous errors
*** 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/josenriq/.rvm/rubies/ruby-1.9.3-head/bin/ruby
/Users/josenriq/.rvm/rubies/ruby-1.9.3-head/lib/ruby/gems/1.9.1/gems/mini_portile-0.5.1/lib/mini_portile.rb:234:in `extract_file': Failed to complete extract task (RuntimeError)
    from /Users/josenriq/.rvm/rubies/ruby-1.9.3-head/lib/ruby/gems/1.9.1/gems/mini_portile-0.5.1/lib/mini_portile.rb:34:in `block in extract'
    from /Users/josenriq/.rvm/rubies/ruby-1.9.3-head/lib/ruby/gems/1.9.1/gems/mini_portile-0.5.1/lib/mini_portile.rb:32:in `each'
    from /Users/josenriq/.rvm/rubies/ruby-1.9.3-head/lib/ruby/gems/1.9.1/gems/mini_portile-0.5.1/lib/mini_portile.rb:32:in `extract'
    from /Users/josenriq/.rvm/rubies/ruby-1.9.3-head/lib/ruby/gems/1.9.1/gems/mini_portile-0.5.1/lib/mini_portile.rb:98:in `cook'
    from extconf.rb:101:in `block in <main>'
    from extconf.rb:119:in `call'
    from extconf.rb:119:in `block in <main>'
    from extconf.rb:109:in `tap'
    from extconf.rb:109:in `<main>'


Gem files will remain installed in /Users/josenriq/.rvm/gems/ruby-1.9.3-head@wdi/gems/nokogiri-1.6.0 for inspection.
Results logged to /Users/josenriq/.rvm/gems/ruby-1.9.3-head@wdi/gems/nokogiri-1.6.0/ext/nokogiri/gem_make.out

似乎与 libxml2 tar 文件无法解压有关.

Seems like it has something to do with the libxml2 tar file not being able to extract.

有什么想法吗?我已经做了大约 8 个小时的研究,但无济于事.谢谢!

Any ideas? I've done maybe 8 hours of research to no avail. Thanks!

推荐答案

我在另一个帖子中找到了答案.我使用的解决方法是告诉 Nokogiri 改用系统库:

I found the answer in another thread. The workaround I used is to tell Nokogiri to use the system libraries instead:

NOKOGIRI_USE_SYSTEM_LIBRARIES=1 bundle install

这篇关于在 mac (libxml2) 上安装 nokogiri 1.6.0 时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆