gem安装不使用自制软件

时间:2012-02-27 16:40:42

标签: ruby-on-rails ruby-on-rails-3 nokogiri bundle homebrew

好吧所以我刚刚安装了自制软件,一切都很棒,但我遇到了安装nokogiri的问题,这是我的问题

$ bundle install
Fetching source index for https://rubygems.org/
Using rake (0.9.2.2) 
Using i18n (0.6.0) 
Using multi_json (1.1.0) 
Using activesupport (3.2.1) 
Using builder (3.0.0) 
Using activemodel (3.2.1) 
Using erubis (2.7.0) 
Using journey (1.0.2) 
Using rack (1.4.1) 
Using rack-cache (1.1) 
Using rack-test (0.6.1) 
Using hike (1.2.1) 
Using tilt (1.3.3) 
Using sprockets (2.1.2) 
Using actionpack (3.2.1) 
Using mime-types (1.17.2) 
Using polyglot (0.3.3) 
Using treetop (1.4.10) 
Using mail (2.4.1) 
Using actionmailer (3.2.1) 
Using arel (3.0.1) 
Using tzinfo (0.3.31) 
Using activerecord (3.2.1) 
Using activeresource (3.2.1) 
Using annotate (2.4.1.beta1) 
Using bcrypt-ruby (3.0.1) 
Using bundler (1.0.22) 
Installing nokogiri (1.5.0) with native extensions 
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.

        /Users/matt_elhotiby/.rvm/rubies/ruby-1.9.2-p290/bin/ruby extconf.rb 
checking for libxml/parser.h... yes
checking for libxslt/xslt.h... yes
checking for libexslt/exslt.h... yes
checking for iconv_open() in iconv.h... no
checking for iconv_open() in -liconv... no
-----
libiconv is missing.  please visit http://nokogiri.org/tutorials/installing_nokogiri.html for help with installing dependencies.
-----

所以我用这个命令来安装它

gem install nokogiri -- --with-xml2-include=/usr/local/Cellar/libxml2/2.7.8/include/libxml2 --with-xml2-lib=/usr/local/Cellar/libxml2/2.7.8/lib --with-xslt-dir=/usr/local/Cellar/libxslt/1.1.26 --with-iconv-include=/usr/local/Cellar/libiconv/1.14/include --with-iconv-lib=/usr/local/Cellar/libiconv/1.14/lib
Building native extensions.  This could take a while...
Successfully installed nokogiri-1.5.0
1 gem installed
Installing ri documentation for nokogiri-1.5.0...
Installing RDoc documentation for nokogiri-1.5.0...

然后我进行健全检查并获得此

gem list nokogiri*** LOCAL GEMS ***
nokogiri (1.5.0)

但由于某种原因,捆绑安装永远不会起作用....,环境是以下

MAC OSX Lion RVM ruby​​-1.9.2-p290

我可以为任何人提供帮助你的任何其他事情都会很棒......

1 个答案:

答案 0 :(得分:3)

解决了

brew install libiconv
[master (Time to Commit)]$ brew link libiconv
Linking /usr/local/Cellar/libiconv/1.14... 16 symlinks created
相关问题