2011-04-13 43 views
0

我在nokogiri中得到以下錯誤。我通過Fink安裝 的libxml2的新圖書館,當我輸入「芬克名單的libxml2」我得到:幫助用新的libxml2安裝nokogiri

i libxml2   2.7.8-102 XML parsing library, version 2 

我也加入到我的.profile到DY_LIBRARY_PATH .../SW/lib下,當我 嘗試運行我的程序,我得到以下警告:

WARNING: Nokogiri was built against LibXML version 2.6.16, but has dynamically loaded 2.7.8 

我如何可以安裝寶石,使其鏈接對新libxml2庫?我安裝 創業板:

sudo gem install nokogiri 

特德

回答

0

從引入nokogiri wiki

指定安裝libxml2和顯示目錄的libxslt 。如果您使用 芬克:

gem install nokogiri -- --with-xml2-include=/sw/include/libxml2 --with-xml2-lib=/sw/lib --with-xslt-dir=/sw 
1

您已閱讀 「Nonstandard libxml2/libxslt installations」 吧?

Fink是Mac OS上的非標準安裝。

%的引入nokogiri安裝文檔:

 
If you’ve got libxml2 and/or libxslt installed in a nonstandard place (read as 「not /opt/local, /usr/local, /usr or the standard Ruby directories」), you can use command-line parameters to the gem install command to grease the wheels: 

gem install nokogiri -- --with-xml2-dir=/home/joe/builds \ 
         --with-xslt-dir=/home/joe/builds 

Or, you can specify include and library directories separately: 

gem install nokogiri -- --with-xml2-lib=/home/joe/builds/lib \ 
         --with-xml2-include=/home/joe/builds/include/libxml2 \ 
         --with-xslt-lib=/home/joe/builds/lib \ 
         --with-xslt-include=/home/joe/builds/include 

Note that, by default, libxslt header files are installed into the root include directory, but libxml2 header files are installed into a subdirectory thereof named libxml2. 
+0

在MacOS上libxml2的標準安裝是什麼? – Flethuseo 2011-04-13 23:17:53

+0

這是Apple安裝的版本。 – 2011-04-14 00:01:31