首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何安装Nokogiri作为Macruby宝石?

如何安装Nokogiri作为Macruby宝石?
EN

Stack Overflow用户
提问于 2010-05-05 19:32:03
回答 2查看 2.3K关注 0票数 3

最新的MacRuby发行说明(版本0.6)指出,作者已经设法使该版本与SQLite和Nokogiri一起工作。然而,当我运行sudo macgem install nokogiri时,我会得到以下错误:

代码语言:javascript
复制
ERROR:  Error installing nokogiri:

extconf失败:

然后是一系列的路径,然后是:

代码语言:javascript
复制
libxml2 is missing.  try 'port install libxml2' or 'yum install libxml2'
/Library/Frameworks/MacRuby.framework/Versions/0.6/usr/lib/ruby/Gems/1.9.0/gems/nokogiri-1.4.1/ext/nokogiri/extconf.rb:1:in `<main>': libxml2 is missing.  try 'port install libxml2' or 'yum install libxml2' (SystemExit)

有人知道怎么做吗?我的平台是MacOSX10.6.3。Nokogiri通常(指普通的老红宝石1.8.7)安装时没有问题。

进展

好吧,我有:

  1. git clone http://github.com/tenderlove/nokogiri.git
  2. cd nokogiri/ext/nokogiri
  3. Then我已经用sudo port upgrade --enforce-variants libxml2 +universalsudo port upgrade --enforce-variants libxslt +universal
  4. Then重新构建了宏端口库,我执行了macruby extconf.rb successfully
  5. Then,然后继续到make

此时,它出现了如下错误:

代码语言:javascript
复制
/usr/bin/gcc -I. -I/opt/local/include/libxml2 -I/opt/local/include/ -I/Library/Frameworks/MacRuby.framework/Versions/0.6/usr/include/ruby-1.9.0/universal-darwin10.0 -I/Library/Frameworks/MacRuby.framework/Versions/0.6/usr/include/ruby-1.9.0/ruby/backward -I/Library/Frameworks/MacRuby.framework/Versions/0.6/usr/include/ruby-1.9.0 -I. -DHAVE_XMLRELAXNGSETPARSERSTRUCTUREDERRORS -DHAVE_XMLRELAXNGSETPARSERSTRUCTUREDERRORS -DHAVE_XMLRELAXNGSETVALIDSTRUCTUREDERRORS -DHAVE_XMLSCHEMASETVALIDSTRUCTUREDERRORS -DHAVE_XMLSCHEMASETPARSERSTRUCTUREDERRORS -I/opt/local/include/ -I/opt/local/include/libxml2 -I/opt/local/include  -fno-common -fexceptions -fno-common -pipe -O3 -g -Wall -Wno-parentheses  -g -DXP_UNIX -O3 -Wall -Wcast-qual -Wwrite-strings -Wconversion -Wmissing-noreturn -Winline -arch i386 -arch x86_64 -o html_document.o -c html_document.c
In file included from ./html_document.h:4,
             from html_document.c:1:
./nokogiri.h:35:16: error: st.h: No such file or directory
In file included from ./html_document.h:4,
             from html_document.c:1:
./nokogiri.h:35:16: error: st.h: No such file or directory
lipo: can't open input file: /var/folders/wU/wUGgoG1JGeKBgwalWLPMAU+++TI/-Tmp-//ccSgAUv5.out (No such file or directory)
make: *** [html_document.o] Error 1
EN

回答 2

Stack Overflow用户

发布于 2010-05-06 04:04:18

我认为您必须从源代码构建,因为只有Nokogiri的头是符合MacRuby的

票数 1
EN

Stack Overflow用户

发布于 2010-05-13 20:38:10

我上传到GitHub,我做了一个包。http://wiki.github.com/Watson1978/nokogiri-macruby/

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

https://stackoverflow.com/questions/2776195

复制
相关文章

相似问题

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