gpt4 book ai didi

ruby - 我无法安装 twilio gem,因为我在安装 install libxml 时遇到错误

转载 作者:数据小太阳 更新时间:2023-10-29 08:43:01 34 4
gpt4 key购买 nike

这是我在 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/

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