gpt4 book ai didi

webrat - 无法构建 gem —— native 扩展构建失败 —— 你能明白为什么吗?

转载 作者:行者123 更新时间:2023-12-02 01:22:53 26 4
gpt4 key购买 nike

我不知道这里出了什么问题——有什么想法吗?

我在 Ubuntu 8.04 LTS 上运行,并按照以下说明安装了 libxml2 和 libxslt:

http://www.techsww.com/tutorials/libraries/libxml/installation/installing_libxml_on_ubuntu_linux.php

http://www.techsww.com/tutorials/libraries/libxslt/installation/installing_libxslt_on_ubuntu_linux.php

但是,我安装了最新版本:

libxslt-1.1.24
libxml2-2.7.3

安装很顺利

-------------------- 我设置LD_LIBRARY_PATH ----------------------------------

回声$LD_LIBRARY_PATH
/usr/local/libxslt/lib:

------------- 看起来该函数是存在的——至少基于字符串的输出 ------------
/usr/local/libxslt/lib$ 字符串 * | grep ParseStylesheetDoc
xsltParseStylesheetDoc
xsltParseStylesheetDoc
xsltParseStylesheetDoc
xsltParseStylesheetDoc
xsltParseStylesheetDoc
xsltParseStylesheetDoc
xsltParseStylesheetDoc

------------------------ 但是编译还是失败-------------------- ----------------------------------

sudo gem install webrat
构建 native 扩展。这可能需要一段时间...
错误:安装 webrat 时出错:
错误:无法构建 gem native 扩展。

/usr/local/bin/ruby extconf.rb 安装 webrat
检查/opt/local/include/、/opt/local/include/libxml2、/opt/local/include、/opt/local/include、/opt/local/include/libxml2、/usr/local 中的 iconv.h/include、/usr/local/include/libxml2、/usr/local/include、/usr/local/include/libxml2、/usr/include、/usr/include/libxml2... 是
检查/opt/local/include/、/opt/local/include/libxml2、/opt/local/include、/opt/local/include、/opt/local/include/libxml2、/usr 中的 libxml/parser.h/local/include、/usr/local/include/libxml2、/usr/local/include、/usr/local/include/libxml2、/usr/include、/usr/include/libxml2... 是
检查/opt/local/include/、/opt/local/include/libxml2、/opt/local/include、/opt/local/include、/opt/local/include/libxml2、/usr 中的 libxslt/xslt.h/local/include、/usr/local/include/libxml2、/usr/local/include、/usr/local/include/libxml2、/usr/include、/usr/include/libxml2... 是
检查/opt/local/include/、/opt/local/include/libxml2、/opt/local/include、/opt/local/include、/opt/local/include/libxml2、/usr 中的 libexslt/exslt.h/local/include、/usr/local/include/libxml2、/usr/local/include、/usr/local/include/libxml2、/usr/include、/usr/include/libxml2... 是
检查 -lxml2 中的 xmlParseDoc()...是
检查 -lxslt 中的 xsltParseStylesheetDoc()... 否
libxslt 丢失。尝试“port install libxslt”或“yum install libxslt-devel”
*** extconf.rb failed ***
由于某种原因无法创建 Makefile,可能缺少
必要的库和/或 header 。检查 mkmf.log 文件了解更多信息
细节。您可能需要配置选项。

Provided configuration options:<br/>
--with-opt-dir<br/>
--without-opt-dir<br/>
--with-opt-include<br/>
--without-opt-include=${opt-dir}/include<br/>
--with-opt-lib<br/>
--without-opt-lib=${opt-dir}/lib<br/>
--with-make-prog<br/>
--without-make-prog<br/>
--srcdir=.<br/>
--curdir<br/>
--ruby=/usr/local/bin/ruby<br/>
--with-iconv-dir<br/>
--without-iconv-dir<br/>
--with-iconv-include<br/>
--without-iconv-include=${iconv-dir}/include<br/>
--with-iconv-lib<br/>
--without-iconv-lib=${iconv-dir}/lib<br/>
--with-xml2-dir<br/>
--without-xml2-dir<br/>
--with-xml2-include<br/>
--without-xml2-include=${xml2-dir}/include<br/>
--with-xml2-lib<br/>
--without-xml2-lib=${xml2-dir}/lib<br/>
--with-xslt-dir<br/>
--without-xslt-dir<br/>
--with-xslt-include<br/>
--without-xslt-include=${xslt-dir}/include<br/>
--with-xslt-lib<br/>
--without-xslt-lib=${xslt-dir}/lib<br/>
--with-xml2lib<br/>
--without-xml2lib<br/>
--with-xsltlib<br/>
--without-xsltlib

Gem 文件将保留安装在/usr/local/lib/ruby/gems/1.8/gems/nokogiri-1.3.3 中以供检查。
结果记录到/usr/local/lib/ruby/gems/1.8/gems/nokogiri-1.3.3/ext/nokogiri/gem_make.out

最佳答案

在 Ubuntu 中,您需要执行以下步骤:sudo apt-get install libxml2-devsudo apt-get install libxslt-dev

关于webrat - 无法构建 gem —— native 扩展构建失败 —— 你能明白为什么吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1225703/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com