2013-12-17 121 views
7

執行時「包安裝」我得到這個錯誤的libxml-紅寶石:無法安裝導軌2.3.14

.......... 

Installing libxml-ruby (2.7.0) 
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension. 

    /home/ubuntu/.rvm/rubies/ruby-1.8.7-p374/bin/ruby extconf.rb 
checking for socket() in -lsocket... no 
checking for gethostbyname() in -lnsl... yes 
checking for atan() in -lm... no 
checking for atan() in -lm... yes 
checking for inflate() in -lz... yes 
checking for iconv_open() in -liconv... no 
checking for libiconv_open() in -liconv... no 
checking for libiconv_open() in -llibiconv... no 
checking for iconv_open() in -llibiconv... no 
checking for iconv_open() in -lc... yes 
checking for xmlParseDoc() in -lxml2... no 
checking for xmlParseDoc() in -llibxml2... no 
checking for xmlParseDoc() in -lxml2... no 
*** 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=/home/ubuntu/.rvm/rubies/ruby-1.8.7-p374/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-zlib-dir 
    --without-zlib-dir 
    --with-zlib-include 
    --without-zlib-include=${zlib-dir}/include 
    --with-zlib-lib 
    --without-zlib-lib=${zlib-dir}/lib 
    --with-socketlib 
    --without-socketlib 
    --with-nsllib 
    --without-nsllib 
    --with-mlib 
    --without-mlib 
    --with-mlib 
    --without-mlib 
    --with-zlib 
    --without-zlib 
    --with-iconvlib 
    --without-iconvlib 
    --with-iconvlib 
    --without-iconvlib 
    --with-libiconvlib 
    --without-libiconvlib 
    --with-libiconvlib 
    --without-libiconvlib 
    --with-clib 
    --without-clib 
    --with-xml2-config 
    --without-xml2-config 
    --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-xml2lib 
    --without-xml2lib 
    --with-libxml2lib 
    --without-libxml2lib 
    --with-xml2lib 
    --without-xml2lib 
extconf failure: need libxml2. 

    Install the library or try one of the following options to extconf.rb: 

     --with-xml2-config=/path/to/xml2-config 
     --with-xml2-dir=/path/to/libxml2 
     --with-xml2-lib=/path/to/libxml2/lib 
     --with-xml2-include=/path/to/libxml2/include 



Gem files will remain installed in /home/ubuntu/.rvm/gems/[email protected]/gems/libxml-ruby-2.7.0 for inspection. 
Results logged to /home/ubuntu/.rvm/gems/[email protected]/gems/libxml-ruby-2.7.0/ext/libxml/gem_make.out 

An error occurred while installing libxml-ruby (2.7.0), and Bundler cannot continue. 
Make sure that `gem install libxml-ruby -v '2.7.0'` succeeds before bundling. 

不是真的知道什麼是錯在這裏。這是在我的另一個盒子上使用相同的ruby和rails版本。

一直試圖弄清楚,但沒有運氣。

請幫忙。 :(..感謝

回答

3

嘗試安裝/重新安裝使用的libxslt默認運行./configure

+6

在Ubuntu上運行 「和apt-get安裝的libxml2-dev的的libxslt-dev的」 固定的問題 – aminalid

9

首先,安裝libxml2-dev

sudo apt-get install libxml2-dev 
1

爲CentOS:

搜索:

yum list libxml2 

安裝:

sudo yum install libxml2 libxml2-devel 

爲Ubuntu:

搜索:

apt-cache search libxml2 

或:

dpkg -l libxml\* 

安裝:

sudo apt-get install libxml2 libxml2-dev