jnf*_*nfr 0 nokogiri osx-mavericks
我遇到了大多数人在后Mavericks升级机上使用nokogiri安装时遇到的同样问题.
/Users/lunchbag/.rvm/rubies/ruby-2.0.0-p451/bin/ruby extconf.rb --with-xml2-include=/usr/local/Cellar/libx/libxml2/2.7.8/include/libxml2 --with-xml2-lib=/usr/local/Cellar/libxml2/2.9.1/lib --with-xslt-dir=/usr/local/Cellar/libxslt/1.1.28 --with-iconv-include=/usr/local/Cellar/libiconv/1.13.1/include --with-iconv-lib=/usr/local/Cellar/libiconv/1.13.1/lib
Extracting libxml2-2.8.0.tar.gz into tmp/x86_64-apple-darwin13.1.0/ports/libxml2/2.8.0... OK
Running 'configure' for libxml2 2.8.0... ERROR, review 'tmp/x86_64-apple-darwin13.1.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/lunchbag/.rvm/rubies/ruby-2.0.0-p451/bin/ruby
/Users/lunchbag/.rvm/rubies/ruby-2.0.0-p451/lib/ruby/gems/2.0.0/gems/mini_portile-0.5.3/lib/mini_portile.rb:278:in `block in execute': Failed to complete configure task (RuntimeError)
from /Users/lunchbag/.rvm/rubies/ruby-2.0.0-p451/lib/ruby/gems/2.0.0/gems/mini_portile-0.5.3/lib/mini_portile.rb:270:in `chdir'
from /Users/lunchbag/.rvm/rubies/ruby-2.0.0-p451/lib/ruby/gems/2.0.0/gems/mini_portile-0.5.3/lib/mini_portile.rb:270:in `execute'
from /Users/lunchbag/.rvm/rubies/ruby-2.0.0-p451/lib/ruby/gems/2.0.0/gems/mini_portile-0.5.3/lib/mini_portile.rb:65:in `configure'
from /Users/lunchbag/.rvm/rubies/ruby-2.0.0-p451/lib/ruby/gems/2.0.0/gems/mini_portile-0.5.3/lib/mini_portile.rb:108: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>'
extconf failed, exit code 1
Gem files will remain installed in /Users/lunchbag/.rvm/gems/ruby-2.0.0-p451/gems/nokogiri-1.6.1 for inspection.
Results logged to /Users/lunchbag/.rvm/gems/ruby-2.0.0-p451/extensions/x86_64-darwin-13/2.0.0/nokogiri-1.6.1/gem_make.out
Run Code Online (Sandbox Code Playgroud)
我的configure.log显示以下错误:
configure: error: cannot find sources (entities.c) in /usr/local/lib/node_modules/npm or ..
Run Code Online (Sandbox Code Playgroud)
我已经尝试安装/重新安装/取消链接/重新链接libxml2,libxslt.
还有其他提示吗?谢谢!
使用Homebrew安装库并NOKOGIRI_USE_SYSTEM_LIBRARIES=1在安装gem之前进行设置对我来说是个窍门.
总结:
如果以前安装过,请卸载gem:
$ gem uninstall nokogiri
使用Homebrew进行安装libxml2,libxslt并且libiconv:
$ brew install libxml2 libxslt libiconv
安装gem指定要链接的库的路径:
$ NOKOGIRI_USE_SYSTEM_LIBRARIES=1 gem install nokogiri -- --use-system-libraries --with-iconv-dir="$(brew --prefix libiconv)" --with-xml2-config="$(brew --prefix libxml2)/bin/xml2-config" --with-xslt-config="$(brew --prefix libxslt)/bin/xslt-config"
| 归档时间: |
|
| 查看次数: |
482 次 |
| 最近记录: |