- xml - AJAX/Jquery XML 解析
- 具有多重继承的 XML 模式
- .net - 枚举序列化 Json 与 XML
- XML 简单类型、简单内容、复杂类型、复杂内容
这是我在 CLI 中收到的错误消息。我尝试了其他帖子中给出的解决方案,例如 sudo gem install twilio-ruby
但这没有用。我正在使用带有 Sierra 的 Mac。我有 ruby 2.4。感谢您的帮助,因为这只是整个周末挑战的一小部分!!我不得不添加更多的单词,因为我发布的大部分是代码,所以这是一个漫谈。
$ gem install libxml-ruby -v '3.0.0'
Building native extensions. This could take a while...
ERROR: Error installing libxml-ruby:
ERROR: Failed to build gem native extension.
current directory: /Users/davidhalewood/.rvm/gems/ruby-2.4.0/gems/libxml-ruby-3.0.0/ext/libxml
/usr/local/opt/ruby/bin/ruby -r ./siteconf20171006-71383-4z74id.rb extconf.rb
/usr/local/opt/ruby/bin/ruby: warning: shebang line ends with \r may cause a problem
checking for libxml/xmlversion.h in /opt/include/libxml2,/opt/local/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
--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=/usr/local/Cellar/ruby/2.4.2/bin/$(RUBY_BASE_NAME)
--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
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
To see why this extension failed to compile, please check the mkmf.log which can be found here:
/Users/davidhalewood/.rvm/gems/ruby-2.4.0/extensions/x86_64-darwin-16/2.4.0/libxml-ruby-3.0.0/mkmf.log
extconf failed, exit code 1
Gem files will remain installed in /Users/davidhalewood/.rvm/gems/ruby-2.4.0/gems/libxml-ruby-3.0.0 for inspection.
Results logged to /Users/davidhalewood/.rvm/gems/ruby-2.4.0/extensions/x86_64-darwin-16/2.4.0/libxml-ruby-3.0.0/gem_make.out
[davidhalewood:...Projects/takeaway-challenge]$ cat /Users/davidhalewood/.rvm/gems/ruby-2.4.0/extensions/x86_64-darwin-16/2.4.0/libxml-ruby-3.0.0/mkmf.log
find_header: checking for libxml/xmlversion.h in /opt/include/libxml2,/opt/local/include/libxml2,/usr/local/include/libxml2,/usr/include/libxml2... -------------------- no
"clang -o conftest -I/usr/local/Cellar/ruby/2.4.2/include/ruby-2.4.0/x86_64-darwin16 -I/usr/local/Cellar/ruby/2.4.2/include/ruby-2.4.0/ruby/backward -I/usr/local/Cellar/ruby/2.4.2/include/ruby-2.4.0 -I. -I/usr/local/opt/libyaml/include -I/usr/local/opt/openssl/include -I/usr/local/opt/readline/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -O3 -fno-fast-math -ggdb3 -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wno-tautological-compare -Wno-parentheses-equality -Wno-constant-logical-operand -Wno-self-assign -Wunused-variable -Wimplicit-int -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wshorten-64-to-32 -Wimplicit-function-declaration -Wdivision-by-zero -Wdeprecated-declarations -Wextra-tokens -fno-common -pipe conftest.c -L. -L/usr/local/Cellar/ruby/2.4.2/lib -L/usr/local/opt/libyaml/lib -L/usr/local/opt/openssl/lib -L/usr/local/opt/readline/lib -L. -fstack-protector -L/usr/local/lib -L/usr/local/opt/libyaml/lib -L/usr/local/opt/openssl/lib -L/usr/local/opt/readline/lib -lruby.2.4.2 -lpthread -ldl -lobjc "
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: int main(int argc, char **argv)
4: {
5: return 0;
6: }
/* end */
"clang -E -I/usr/local/Cellar/ruby/2.4.2/include/ruby-2.4.0/x86_64-darwin16 -I/usr/local/Cellar/ruby/2.4.2/include/ruby-2.4.0/ruby/backward -I/usr/local/Cellar/ruby/2.4.2/include/ruby-2.4.0 -I. -I/usr/local/opt/libyaml/include -I/usr/local/opt/openssl/include -I/usr/local/opt/readline/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -O3 -fno-fast-math -ggdb3 -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wno-tautological-compare -Wno-parentheses-equality -Wno-constant-logical-operand -Wno-self-assign -Wunused-variable -Wimplicit-int -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wshorten-64-to-32 -Wimplicit-function-declaration -Wdivision-by-zero -Wdeprecated-declarations -Wextra-tokens -fno-common -pipe conftest.c -o conftest.i"
conftest.c:3:10: fatal error: 'libxml/xmlversion.h' file not found
#include <libxml/xmlversion.h>
^~~~~~~~~~~~~~~~~~~~~
1 error generated.
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: #include <libxml/xmlversion.h>
/* end */
"clang -E -I/usr/local/Cellar/ruby/2.4.2/include/ruby-2.4.0/x86_64-darwin16 -I/usr/local/Cellar/ruby/2.4.2/include/ruby-2.4.0/ruby/backward -I/usr/local/Cellar/ruby/2.4.2/include/ruby-2.4.0 -I. -I/usr/local/opt/libyaml/include -I/usr/local/opt/openssl/include -I/usr/local/opt/readline/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -O3 -fno-fast-math -ggdb3 -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wno-tautological-compare -Wno-parentheses-equality -Wno-constant-logical-operand -Wno-self-assign -Wunused-variable -Wimplicit-int -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wshorten-64-to-32 -Wimplicit-function-declaration -Wdivision-by-zero -Wdeprecated-declarations -Wextra-tokens -fno-common -pipe -I/opt/include/libxml2 conftest.c -o conftest.i"
conftest.c:3:10: fatal error: 'libxml/xmlversion.h' file not found
#include <libxml/xmlversion.h>
^~~~~~~~~~~~~~~~~~~~~
1 error generated.
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: #include <libxml/xmlversion.h>
/* end */
"clang -E -I/usr/local/Cellar/ruby/2.4.2/include/ruby-2.4.0/x86_64-darwin16 -I/usr/local/Cellar/ruby/2.4.2/include/ruby-2.4.0/ruby/backward -I/usr/local/Cellar/ruby/2.4.2/include/ruby-2.4.0 -I. -I/usr/local/opt/libyaml/include -I/usr/local/opt/openssl/include -I/usr/local/opt/readline/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -O3 -fno-fast-math -ggdb3 -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wno-tautological-compare -Wno-parentheses-equality -Wno-constant-logical-operand -Wno-self-assign -Wunused-variable -Wimplicit-int -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wshorten-64-to-32 -Wimplicit-function-declaration -Wdivision-by-zero -Wdeprecated-declarations -Wextra-tokens -fno-common -pipe -I/opt/local/include/libxml2 conftest.c -o conftest.i"
conftest.c:3:10: fatal error: 'libxml/xmlversion.h' file not found
#include <libxml/xmlversion.h>
^~~~~~~~~~~~~~~~~~~~~
1 error generated.
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: #include <libxml/xmlversion.h>
/* end */
"clang -E -I/usr/local/Cellar/ruby/2.4.2/include/ruby-2.4.0/x86_64-darwin16 -I/usr/local/Cellar/ruby/2.4.2/include/ruby-2.4.0/ruby/backward -I/usr/local/Cellar/ruby/2.4.2/include/ruby-2.4.0 -I. -I/usr/local/opt/libyaml/include -I/usr/local/opt/openssl/include -I/usr/local/opt/readline/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -O3 -fno-fast-math -ggdb3 -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wno-tautological-compare -Wno-parentheses-equality -Wno-constant-logical-operand -Wno-self-assign -Wunused-variable -Wimplicit-int -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wshorten-64-to-32 -Wimplicit-function-declaration -Wdivision-by-zero -Wdeprecated-declarations -Wextra-tokens -fno-common -pipe -I/usr/local/include/libxml2 conftest.c -o conftest.i"
conftest.c:3:10: fatal error: 'libxml/xmlversion.h' file not found
#include <libxml/xmlversion.h>
^~~~~~~~~~~~~~~~~~~~~
1 error generated.
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: #include <libxml/xmlversion.h>
/* end */
"clang -E -I/usr/local/Cellar/ruby/2.4.2/include/ruby-2.4.0/x86_64-darwin16 -I/usr/local/Cellar/ruby/2.4.2/include/ruby-2.4.0/ruby/backward -I/usr/local/Cellar/ruby/2.4.2/include/ruby-2.4.0 -I. -I/usr/local/opt/libyaml/include -I/usr/local/opt/openssl/include -I/usr/local/opt/readline/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -O3 -fno-fast-math -ggdb3 -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wno-tautological-compare -Wno-parentheses-equality -Wno-constant-logical-operand -Wno-self-assign -Wunused-variable -Wimplicit-int -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wshorten-64-to-32 -Wimplicit-function-declaration -Wdivision-by-zero -Wdeprecated-declarations -Wextra-tokens -fno-common -pipe -I/usr/include/libxml2 conftest.c -o conftest.i"
conftest.c:3:10: fatal error: 'libxml/xmlversion.h' file not found
#include <libxml/xmlversion.h>
^~~~~~~~~~~~~~~~~~~~~
1 error generated.
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: #include <libxml/xmlversion.h>
/* end */
最佳答案
我在 MacOS Sierra 上遇到了同样的问题。在我的例子中,解决方案是更新 Xcode 工具:xcode-select --install
关于ruby - 我无法安装 twilio gem,因为我在安装 install libxml 时遇到错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46613153/
我已经下载了草莓 PERL 并在 Winxp sp3 上使用 CGI Perl Apache 编写了一个应用程序。我使用的库之一(由其他人编写)使用 XML::LibXML。当我加载页面时,它给出内部
libxml 在 libxml.h 中使用以下代码行,但它不与 libxml 捆绑在一起。 #include "config.h" 我正在尝试在 Swift 中使用 XMPPFramework for
我知道这个问题经常出现,但我查看了所有其他答案,但没有一个与我相关。 我正在尝试从源代码编译神经成像软件 FSL(我必须这样做,我的 Linux 发行版不支持它)。我已按照所有说明进行操作 liste
当我运行 cyrus-imapd-2.4.17-caldav-beta9 时出现以下错误: In file included from httpd.c:68:0: httpd.h:48:25: fat
我熟悉 XML,已经将它用于一些简单的用途。但是,我被要求创建一个自定义解决方案(必须使用 Perl)来向 AuthorizeNet 的网关提交付款。 AuthNet 不提供对 Perl 的支持,所以
我有一个示例 Perl 脚本,我试图根据模式加载和验证文件,它们询问各种节点。 #!/usr/bin/env perl use strict; use warnings; use XML::LibXM
我有我正在迭代的非常大的 XML 文档。 XML 主要使用属性而不是节点值。我可能需要在文件中找到许多节点来拼凑一组信息。它们通过不同的 ref 标签值联系在一起。目前,每次我需要定位其中一个节点以从
我正在使用 XML::LibXML,我想添加一条注释,使注释位于标签之外。甚至可以把它放在标签外面吗?我试过 appendChild,insertBefore |之后,没有区别... jun
我正在使用 XML::LibXML,我想添加一条注释,使注释位于标签之外。甚至可以把它放在标签外面吗?我试过 appendChild,insertBefore |之后,没有区别... jun
我正在尝试使用 ISO-8859-1 中的 libxml2 编写 XML 文件。但从文档看来,对于我创建的每个文本节点,我都必须转换为 UTF-8,这是 libxml 的内部编码。然后,当调用 xml
我正在尝试用 C++ 解析 XML 文档。我没有与文档关联的任何形式的元数据。由于我是 XML 的新手,所以我想了解解析此 xml 的最佳方法。我正在使用 libxml2 来实现这一点。 我目前正在做
使用 libxml2 两天后我就遇到了一个问题,这让我很烦。 基本上,我使用套接字通过网络发送一个 xml 缓冲区。当我在服务器上收到它并尝试解析它时,它说: parser error : Input
我正在使用 libxml 的 HTML 解析器来创建 html 文档的 dom 树。 libxml 将每个节点的文本内容作为一个整体字符串(节点)给出,但我的要求是进一步拆分每个文本节点的空格并创建尽
我已经开始在 C 中使用 libxml,并且正在使用 xmlXPathEvalExpression 函数来计算 XPath。 我的 XML 文件实际上代表一个表,每个子节点代表该表中的一行,其属性是对
我有一个可以通过终端运行的源文件 gcc source.c -I/usr/include/libxml2 -lxml2 -o output 但是当我 #include 包含 libxml 源文件的源文
这里似乎有些奇怪。 在下面的示例中,我通过 XPath 查询 ( //book/isbn/text() ) 访问文本节点。 text()有必要强制XML::LibXML允许我使用 XML::LibXM
我有一个 XML 文件,如下 示例.xml test 以下代码未找到 id 标记值: use XML::LibXML; my $filename = 'example.xml'; my
我正在与 XML::LibXML 一起工作在 Perl 中。 假设我有两个 $element由不同(不透明)XPath 查询获得的引用。 (如何)我可以确定,如果两个$element (节点)refs
我有一个问题,我肯定可以使用一些帮助。首先,要温柔。我是 perl 和 LibXML 的新手。我一直在解析文档并将元素放入一个数组中,然后将其写入电子表格列。在测试过程中发现一些节点有多个同名的子节点
在我的一生中,我无法找出正确的代码来访问我的 XML 文件中的注释行。我是否使用 findnodes , find , getElementByTagName (怀疑)。 我是否正确假设这些评论行是可
我是一名优秀的程序员,十分优秀!