2013-12-14 36 views
0

嘗試安裝引入nokogiri安裝引入nokogiri寶石,我得到以下錯誤在OS X

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... yes 
checking for xmlParseDoc() in -lxml2... yes 
checking for xsltParseStylesheetDoc() in -lxslt... yes 
checking for exsltFuncRegister() in -lexslt... yes 
checking for xmlHasFeature()... yes 
checking for xmlFirstElementChild()... yes 
checking for xmlRelaxNGSetParserStructuredErrors()... yes 
checking for xmlRelaxNGSetParserStructuredErrors()... yes 
checking for xmlRelaxNGSetValidStructuredErrors()... yes 
checking for xmlSchemaSetValidStructuredErrors()... yes 
checking for xmlSchemaSetParserStructuredErrors()... yes 
creating Makefile 

make 
compiling html_document.c 
cc1: error: -Werror=shorten-64-to-32: no option -Wshorten-64-to-32 
make: *** [html_document.o] Error 1 

我想我需要使用BREW安裝gcc,而一個我,但我不記得如何! :)

我:

gcc -v 
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1 
Apple LLVM version 5.0 (clang-500.2.79) (based on LLVM 3.3svn) 
Target: x86_64-apple-darwin12.5.0 
Thread model: posix 

的感謝!

+0

你可以看一下提供[這裏]答案(http://stackoverflow.com/questions/9353444/how-to-use-install-gcc-on-mac-os- X-10-8-的Xcode-4-4#答案-12238 448) – bjhaid

回答

0

您的GCC版本看起來不錯。我在Mavericks上(看起來你是Lion上的?),所以我的版本略有不同(x86_64-apple-darwin13.0.0,而不是x86_64-apple-darwin12.5.0),但是與您發佈的內容完全相同。

我有nokogiri的問題,直到我有RVM設置爲使用Ruby 1.9.3作爲默認值而不是1.9.2。當我將Vagrant更新到1.4.0時,我的nokogiri寶石被拉進了,但沒有用「gem install nokogiri」自己安裝。我只是跑了一個「寶石安裝nokogiri」,它爲我重建沒有錯誤。

我建議你做以下幾點:

  1. 釀造更新#以防萬一
  2. RVM使用Ruby-1.9.3-P392
  3. RVM別名創建默認紅寶石1.9.3-P392
  4. 創業板安裝引入nokogiri