在Mac OS X 10.4.11上安装机械化gem会导致'无法构建gem原生扩展' [英] Installing mechanize gem on Mac OS X 10.4.11 gives 'Failed to build gem native extension'

查看:108
本文介绍了在Mac OS X 10.4.11上安装机械化gem会导致'无法构建gem原生扩展'的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


错误:错误:安装时出现错误机械化:

错误:无法构建gem本机扩展。


$ b $ / usr / local / bin / ruby​​ extconf.rb install mechanize

检查#include

...是

检查#include

...是

检查#包括

...是

检查#include

...是

在-lxml2中检查xmlParseDoc()。 ..是

检查xsltParseStylesheetDoc()in -lxslt ...是

检查exsltFuncRegister()in -lexslt ...是

创建Makefile

** make
gcc -I。 -一世。 -I / usr / local / lib / ruby​​ / 1.8 / i686-darwin8.9.1 -I。 -I / opt / local / include / -I / opt / local / include / libxml2 -fno-common -g -O2 -pipe -fno-common -g -DXP_UNIX -O3 -Wall -Wcast-qual -Wwrite-strings - Wconversion -Wmissing-noreturn -Winline -c html_document.c

从./html_document.h:4包含的文件中,从html_document.c获取

:1:

./native.h:11:28:error:libxml / xmlsave.h:没有这样的文件或目录

make:* ** [html_document.o]错误1 **


因此,xmlsave.h无法在/ opt / local / include /或/ opt / local / include / libxml2中找到$​​ b $ b是libxml2作为框架安装在/Library/Frameworks/libxml2.framework /



然后我决定创建一个从libxml头文件目录到/ opt / local / include的符号链接/ xml2,所以我做了

  ln -s /Library/Frameworks/libxml2.framework/Headers/libxml/ libxml2 

但我仍然无法安装该宝石。



任何指针或想法都是非常重要的我遇到了同样的问题,没有安装机械化,而是安装了webrat。以下是我的工作:

  sudo ln -s / usr / include / libxml2 / opt / local / include / libxml2 


I'm trying to install mechanize gem on a MAC OS X but I keep getting the following error :

ERROR: Error installing mechanize:
ERROR: Failed to build gem native extension.

/usr/local/bin/ruby extconf.rb install mechanize
checking for #include
... yes
checking for #include
... yes
checking for #include
... yes
checking for #include
... yes
checking for xmlParseDoc() in -lxml2... yes
checking for xsltParseStylesheetDoc() in -lxslt... yes
checking for exsltFuncRegister() in -lexslt... yes
creating Makefile

** make gcc -I. -I. -I/usr/local/lib/ruby/1.8/i686-darwin8.9.1 -I. -I/opt/local/include/ -I/opt/local/include/libxml2 -fno-common -g -O2 -pipe -fno-common -g -DXP_UNIX -O3 -Wall -Wcast-qual -Wwrite-strings -Wconversion -Wmissing-noreturn -Winline -c html_document.c
In file included from ./html_document.h:4,
from html_document.c:1:
./native.h:11:28: error: libxml/xmlsave.h: No such file or directory
make: * ** [html_document.o] Error 1**

So xmlsave.h could not be found inside /opt/local/include/ or /opt/local/include/libxml2 The thing is libxml2 is installed as a framework at /Library/Frameworks/libxml2.framework/

Then I decided to create a symlink from libxml headers directory to /opt/local/include/xml2 so I did

ln -s /Library/Frameworks/libxml2.framework/Headers/libxml/ libxml2

but I still can't install the gem.

Any pointers or ideas are very much appreciated.

解决方案

I ran into this same issue, not installing mechanize but webrat. Here's what worked for me:

sudo ln -s /usr/include/libxml2 /opt/local/include/libxml2

这篇关于在Mac OS X 10.4.11上安装机械化gem会导致'无法构建gem原生扩展'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆