首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >错误Rails - libxml-Ruby

错误Rails - libxml-Ruby
EN

Stack Overflow用户
提问于 2014-03-09 18:02:58
回答 1查看 5.8K关注 0票数 5

在设置我的活动商人git时,我一直在努力解决安装libxml-ruby时出现的错误。我已经搜索了很多次错误的所有组件,但我只是不太确定我在看什么。有一堆“不”-有人知道怎么解释我可能错过了什么吗?

代码语言:javascript
复制
Building native extensions.  This could take a while...
ERROR:  Error installing libxml-ruby:
ERROR: Failed to build gem native extension.

/Users/tommynicholas/.rvm/rubies/ruby-2.1.1/bin/ruby extconf.rb
checking for socket() in -lsocket... no
checking for gethostbyname() in -lnsl... no
checking for atan() in -lm... yes
checking for inflate() in -lz... yes
checking for iconv_open() in -liconv... yes
checking for xmlParseDoc() in -lxml2... yes
checking for libxml/xmlversion.h... no
checking for libxml/xmlversion.h in     /opt/include/libxml2,/usr/local/include/libxml2,/usr/include/libxml2... 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=/Users/tommynicholas/.rvm/rubies/ruby-2.1.1/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-zlib
--without-zlib
--with-iconvlib
--without-iconvlib
--with-xml2-config
--without-xml2-config
--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


extconf failed, exit code 1

Gem files will remain installed in /Users/tommynicholas/.rvm/rubies/ruby-    2.1.1/lib/ruby/gems/2.1.0/gems/libxml-ruby-2.7.0 for inspection.
Results logged to /Users/tommynicholas/.rvm/rubies/ruby-    2.1.1/lib/ruby/gems/2.1.0/extensions/x86_64-darwin-13/2.1.0/libxml-ruby-2.7.0/gem_make.out
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2014-03-09 19:01:57

检查/opt/include/libxml 2、/usr/local/include/libxml 2、/usr/include/libxml 2中的libxml/xmlversion.h .不是

告诉我你可能想念libxml2

试着安装它:

代码语言:javascript
复制
sudo apt-get install libxml2-dev

那么,正如TommyNicholas所要求的,我将尝试解释为什么我会放大所有其他的libxml2 --这是一种直觉,但我有一些线索:

  1. 这是安装声明失败之前的最后一行,因此该行很有可能成为一个关键错误(安装在其他故障之后继续进行.)它可能不是唯一的,但它值得注意。
  2. 错误消息显示,它在/opt/include//usr/local/include/usr/include/下搜索了/opt/include//usr/local/include/usr/include/,没有找到它,因此它没有安装是合理的。
  3. 众所周知,在Nokogiri时也会发生类似的错误,因此尝试相同的解决方案并不会有什么害处。
  4. 无论如何,如果其他所有的方法都失败了- RTFM -尽管我的猜测成功了,下一步是读取错误消息,这表明日志中可能有一个更完整的报告- mkmg.log

有关更多细节,请查看mkmf.log文件。

票数 19
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/22285905

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档