在OS Mavericks上安装nokogiri

时间:2014-08-21 00:14:38

标签: ruby-on-rails ruby nokogiri

Mac:OS X Mavericks 10.9.2 Ruby:2.1.2

我正在尝试为rails安装nokogiri,并在构建打包库时遇到错误。 libiconv丢失,我转到错误消息中给出的installation page,但遇到警告消息,我不确定该怎么做。

以下是我运行bundle时的结果:

 Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

    /Users/user/.rvm/rubies/ruby-2.1.2/bin/ruby extconf.rb 
Building nokogiri using packaged libraries.
-----
libiconv is missing.  please visit http://nokogiri.org/tutorials/installing_nokogiri.html for help with installing dependencies.
-----
*** 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/user/.rvm/rubies/ruby-2.1.2/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

extconf failed, exit code 1

Gem files will remain installed in /Users/user/.rvm/gems/ruby-2.1.2@campus-taps-master/gems/nokogiri-1.6.3.1 for inspection.
Results logged to /Users/user/.rvm/gems/ruby-2.1.2@campus-taps-master/extensions/x86_64-darwin-13/2.1.0-static/nokogiri-1.6.3.1/gem_make.out
An error occurred while installing nokogiri (1.6.3.1), and Bundler cannot
continue.
Make sure that `gem install nokogiri -v '1.6.3.1'` succeeds before bundling.

然后我按照说明运行brew install libxml2 libxslt并且很好,但是当我运行brew link libxml2 libxslt时。我收到这两条警告信息:

Warning: libxml2 is keg-only and must be linked with --force
Note that doing so can interfere with building software.
Warning: libxslt is keg-only and must be linked with --force
Note that doing so can interfere with building software.

我不知道该怎么办,也不想弄乱我的系统。

0 个答案:

没有答案
相关问题