我一直試圖在Mac OS 10.9.3上安裝Nokogiri,無論我如何嘗試,最終安裝都會失敗,并顯示以下錯誤消息:$ sudo gem install nokogiri -- --with-xml2-include=/usr/local/Cellar/libxml2/2.9.1/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.14/include --with-iconv-lib=/usr/local/Cellar/libiconv/1.14/libBuilding native extensions with: '--with-xml2-include=/usr/local/Cellar/libxml2/2.9.1/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.14/include --with-iconv-lib=/usr/local/Cellar/libiconv/1.14/lib'This could take a while...Building nokogiri using packaged libraries.ERROR: Error installing nokogiri: ERROR: Failed to build gem native extension. /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby extconf.rb --with-xml2-include=/usr/local/Cellar/libxml2/2.9.1/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.14/include --with-iconv-lib=/usr/local/Cellar/libiconv/1.14/libBuilding nokogiri using packaged libraries.checking for iconv.h... yeschecking for iconv_open() in iconv.h... nochecking for iconv_open() in -liconv... nochecking for libiconv_open() in iconv.h... nochecking for libiconv_open() in -liconv... no-----libiconv is missing. please visit http://nokogiri.org/tutorials/installing_nokogiri.html for help with installing dependencies.-----Gem files will remain installed in /Library/Ruby/Gems/2.0.0/gems/nokogiri-1.6.2.1 for inspection.Results logged to /Library/Ruby/Gems/2.0.0/gems/nokogiri-1.6.2.1/ext/nokogiri/gem_make.out遵循了很多在網(wǎng)上找到的幫助,包括使用brew來構(gòu)建和安裝libxml2和libxslt以及從源代碼構(gòu)建libiconv之后(如“ 安裝Nokogiri ”中所述),錯誤仍然存在。嘗試為Nokogiri運行安裝時,似乎可以找到libxml2和libxslt,但不能找到libiconv。任何對這些事情有更好了解的人都知道如何安裝Nokogiri?
為什么在Mac OS上安裝Nokogiri失敗并缺少libiconv?
慕無忌1623718
2019-11-22 14:00:02