2010-03-15 65 views
0

我試圖在我的Mac上安裝webrat,但是我有錯誤,圖標v.h丟失。這裏是日誌:未能在Mac OS X上安裝nokogiri和webrat

Building native extensions. This could take a while... 
ERROR: Error installing webrat: 
ERROR: Failed to build gem native extension. 

/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb 
checking for iconv.h in /opt/local/include/,/opt/local/include/libxml2,/opt/local/include,/opt/local/include,/opt/local/include/libxml2,/usr/local/include,/usr/local/include/libxml2,/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/include,/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/include/libxml2,/usr/include,/usr/include/libxml2... no 
iconv is missing. try 'port install iconv' or 'yum install iconv' 
*** 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=/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby 
--with-iconv-dir 
--without-iconv-dir 
--with-iconv-include 
--without-iconv-include=${iconv-dir}/include 
--with-iconv-lib 
--without-iconv-lib=${iconv-dir}/lib 
--with-xml2-dir 
--without-xml2-dir 
--with-xml2-include 
--without-xml2-include=${xml2-dir}/include 
--with-xml2-lib 
--without-xml2-lib=${xml2-dir}/lib 
--with-xslt-dir 
--without-xslt-dir 
--with-xslt-include 
--without-xslt-include=${xslt-dir}/include 
--with-xslt-lib 
--without-xslt-lib=${xslt-dir}/lib 


Gem files will remain installed in /Library/Ruby/Gems/1.8/gems/nokogiri-1.4.1 for inspection. 
Results logged to /Library/Ruby/Gems/1.8/gems/nokogiri-1.4.1/ext/nokogiri/gem_make.out 

奇怪的是,iconv.h已經在/ opt/local/include /目錄中。

任何人都可以推薦一個解決方案嗎?

THX, 禮服

+0

用什麼用戶你安裝這個寶石?根或你的用戶? – shingara 2010-03-15 09:34:31

回答

0

好吧,我解決它在我自己的。 經過幾天的研究和嘗試,我發現,我的g ++和gcc的安裝被破壞了。我已經通過macports安裝了g ++的更新,並且在我當前用戶的.profile文件中,來自macports的PATH var中有一個值。我刪除它,現在它可以工作。

的PATH VAR應該是這樣的:

export PATH=/opt/local/bin:/opt/local/sbin:$PATH