首页 > 其他 > 详细

An error occurred while installing nokogiri (1.6.2.1), and Bundler cannot continue.

时间:2016-02-03 01:04:33      阅读:2080      评论:0      收藏:0      [点我收藏+]

系统为mac os 10.11,command tool什么的都安装了

在执行bundle install时出现下面错误:

An error occurred while installing nokogiri (1.6.2.1), and Bundler cannot continue.

  Make sure that `gem install nokogiri -v ‘1.6.2.1‘` succeeds before bundling.

往前翻了下,错误详细为:

Installing nokogiri 1.6.2.1 with native extensions
Building nokogiri using packaged libraries.

Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.

        /usr/local/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=/usr/local/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


Gem files will remain installed in /Users/sophia/ashelf/vendor/bundle/gems/nokogiri-1.6.2.1 for inspection.
Results logged to /Users/sophia/ashelf/vendor/bundle/gems/nokogiri-1.6.2.1/ext/nokogiri/gem_make.out

里面有一句:“libiconv is missing. please visit http://nokogiri.org/tutorials/installing_nokogiri.html for help with installing dependencies.”

解决方法:

 brew install libiconv

brew link libiconv

然后看到输出的链接地址为“/usr/local/Cellar/libiconv/1.14/

执行命令:

gem install nokogiri  -v ‘1.6.2.1‘ -- --with-iconv-dir=/usr/local/Cellar/libiconv/1.14/

上面这个命令每次执行都没有加 -v ‘1.6.2.1‘ ,所以一直装的1.6.7.2,导致bundle install总失败,好二啊/(ㄒoㄒ)/~~

An error occurred while installing nokogiri (1.6.2.1), and Bundler cannot continue.

原文:http://www.cnblogs.com/Sophiawow/p/5178820.html

(1)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!