Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/ruby/23.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby on rails Bundler赢得';t安装libxml-ruby(2.2.2)Rails_Ruby On Rails_Ruby_Legacy Code - Fatal编程技术网

Ruby on rails Bundler赢得';t安装libxml-ruby(2.2.2)Rails

Ruby on rails Bundler赢得';t安装libxml-ruby(2.2.2)Rails,ruby-on-rails,ruby,legacy-code,Ruby On Rails,Ruby,Legacy Code,我正在尝试安装一个有点过时的Rails应用程序,这样我就可以尝试更新它一点,但我似乎无法让捆绑安装正常工作。它一直在告诉我: An error occurred while installing libxml-ruby (2.2.2), and Bundler cannot continue. Make sure that `gem install libxml-ruby -v '2.2.2'` succeeds before bundling. 整个错误是: Gem::Ext::BuildE

我正在尝试安装一个有点过时的Rails应用程序,这样我就可以尝试更新它一点,但我似乎无法让捆绑安装正常工作。它一直在告诉我:

An error occurred while installing libxml-ruby (2.2.2), and Bundler cannot continue.
Make sure that `gem install libxml-ruby -v '2.2.2'` succeeds before bundling.
整个错误是:

Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

/home/camillavk/.rvm/rubies/ruby-2.1.5/bin/ruby -r ./siteconf20150122-7039-3vyx6p.rb extconf.rb                                                                      
extconf.rb:17:in `<main>': Use RbConfig instead of obsolete and deprecated Config.                                                                                       
extconf.rb:17:in `<main>': Use RbConfig instead of obsolete and deprecated Config.                                                                                       
checking for socket() in -lsocket... no                                                                                                                                  
checking for gethostbyname() in -lnsl... yes                                                                                                                             
checking for atan() in -lm... yes                                                                                                                                        
checking for inflate() in -lz... yes                                                                                                                                     
checking for iconv_open() in -liconv... no                                                                                                                               
checking for libiconv_open() in -liconv... no                                                                                                                            
checking for libiconv_open() in -llibiconv... no                                                                                                                         
checking for iconv_open() in -llibiconv... no                                                                                                                            
checking for iconv_open() in -lc... yes                                                                                                                                  
checking for xmlParseDoc() in -lxml2... yes                                                                                                                              
checking for libxml/xmlversion.h... no                                                                                                                                   
checking for libxml/xmlversion.h in /opt/include/libxml2,/usr/local/include/libxml2,/usr/include/libxml2... yes                                                          
creating extconf.h                                                                                                                                                       
creating Makefile                                                                                                                                                        

make "DESTDIR=" clean                                                                                                                                                    

make "DESTDIR="                                                                                                                                                          
compiling ruby_xml_html_parser_options.c                                                                                                                                 
compiling ruby_xml_cbg.c                                                                                                                                                 
compiling ruby_xml_html_parser.c
compiling ruby_xml_relaxng.c
compiling ruby_xml_schema.c
compiling ruby_xml_xpath_expression.c
compiling ruby_xml_parser.c
compiling ruby_xml_io.c
compiling ruby_xml_error.c
compiling ruby_xml_html_parser_context.c
ruby_xml_html_parser_context.c: In function ‘rxml_html_parser_context_options_set’:
ruby_xml_html_parser_context.c:307:7: warning: variable ‘result’ set but not used [-Wunused-but-set-variable]
   int result;
       ^
compiling ruby_xml_node.c
ruby_xml_node.c: In function ‘rxml_node_to_s’:
ruby_xml_node.c:585:54: error: dereferencing pointer to incomplete type
     result = rxml_new_cstr((const char*) output->conv->content, xencoding);
                                                      ^
ruby_xml_node.c:587:56: error: dereferencing pointer to incomplete type
     result = rxml_new_cstr((const char*) output->buffer->content, xencoding);
                                                        ^
make: *** [ruby_xml_node.o] Error 1

make failed, exit code 2

Gem files will remain installed in /home/camillavk/.rvm/gems/ruby-2.1.5/gems/libxml-ruby-2.2.2 for inspection.
Results logged to /home/camillavk/.rvm/gems/ruby-2.1.5/extensions/x86_64-linux/2.1.0/libxml-ruby-2.2.2/gem_make.out
An error occurred while installing libxml-ruby (2.2.2), and Bundler cannot continue.
Make sure that `gem install libxml-ruby -v '2.2.2'` succeeds before bundling.
但是当我使用bundle安装时,同样的错误再次发生

当我尝试

gem install libxml-ruby -v '2.2.2'
我得到这个错误:

Building native extensions.  This could take a while...
ERROR:  Error installing libxml-ruby:
        ERROR: Failed to build gem native extension.

    /home/camillavk/.rvm/rubies/ruby-2.1.5/bin/ruby -r ./siteconf20150122-7254-1rcd0x0.rb extconf.rb
extconf.rb:17:in `<main>': Use RbConfig instead of obsolete and deprecated Config.
extconf.rb:17:in `<main>': Use RbConfig instead of obsolete and deprecated Config.
checking for socket() in -lsocket... no
checking for gethostbyname() in -lnsl... yes
checking for atan() in -lm... yes
checking for inflate() in -lz... yes
checking for iconv_open() in -liconv... no
checking for libiconv_open() in -liconv... no
checking for libiconv_open() in -llibiconv... no
checking for iconv_open() in -llibiconv... no
checking for iconv_open() in -lc... yes
checking for xmlParseDoc() in -lxml2... yes
checking for libxml/xmlversion.h... no
checking for libxml/xmlversion.h in /opt/include/libxml2,/usr/local/include/libxml2,/usr/include/libxml2... yes
creating extconf.h
creating Makefile

make "DESTDIR=" clean

make "DESTDIR="
compiling ruby_xml_html_parser_options.c
compiling ruby_xml_cbg.c
compiling ruby_xml_html_parser.c
compiling ruby_xml_relaxng.c
compiling ruby_xml_schema.c
compiling ruby_xml_xpath_expression.c
compiling ruby_xml_parser.c
compiling ruby_xml_io.c
compiling ruby_xml_error.c
compiling ruby_xml_html_parser_context.c
ruby_xml_html_parser_context.c: In function ‘rxml_html_parser_context_options_set’:
ruby_xml_html_parser_context.c:307:7: warning: variable ‘result’ set but not used [-Wunused-but-set-variable]
   int result;
       ^
compiling ruby_xml_node.c
ruby_xml_node.c: In function ‘rxml_node_to_s’:
ruby_xml_node.c:585:54: error: dereferencing pointer to incomplete type
     result = rxml_new_cstr((const char*) output->conv->content, xencoding);
                                                      ^
ruby_xml_node.c:587:56: error: dereferencing pointer to incomplete type
     result = rxml_new_cstr((const char*) output->buffer->content, xencoding);
                                                        ^
make: *** [ruby_xml_node.o] Error 1

make failed, exit code 2

Gem files will remain installed in /home/camillavk/.rvm/gems/ruby-2.1.5/gems/libxml-ruby-2.2.2 for inspection.
Results logged to /home/camillavk/.rvm/gems/ruby-2.1.5/extensions/x86_64-linux/2.1.0/libxml-ruby-2.2.2/gem_make.out
构建本机扩展。这可能需要一段时间。。。
错误:安装libxml ruby时出错:
错误:无法生成gem本机扩展。
/home/camillavk/.rvm/rubies/ruby-2.1.5/bin/ruby-r./siteconf20150122-7254-1rcd0x0.rb extconf.rb
extconf.rb:17:in`:使用RbConfig而不是过时和不推荐的配置。
extconf.rb:17:in`:使用RbConfig而不是过时和不推荐的配置。
正在检查-lsocket中的套接字()。。。不
正在-lnsl中检查gethostbyname()。。。对
正在检查-lm中的atan()。。。对
正在检查-lz中的充气()。。。对
正在-liconv中检查iconv_open()。。。不
正在-liconv中检查libiconv_open()。。。不
正在检查-llibiconv中的libiconv_open()。。。不
正在-llibiconv中检查iconv_open()。。。不
正在检查-lc中的iconv_open()。。。对
正在-lxml2中检查xmlParseDoc()。。。对
正在检查libxml/xmlversion.h。。。不
正在/opt/include/libxml2、/usr/local/include/libxml2、/usr/include/libxml2中检查libxml/xmlversion.h。。。对
创建extconf.h
创建Makefile
使“DESTDIR=”干净
使“DESTDIR=”
编译ruby\uXML\uHTML\uParser\uOptions.c
编译ruby\uxml\ucbg.c
编译ruby\uXML\uHTML\uParser.c
编译ruby\u xml\u relaxng.c
编译ruby_xml_schema.c
编译ruby\uxml\uxpath\u expression.c
编译ruby_xml_parser.c
编译ruby\uxml\uio.c
编译ruby\u xml\u error.c
编译ruby\uXML\uHTML\uParser\uContext.c
ruby\u xml\u html\u parser\u context.c:在函数“rxml\u html\u parser\u context\u options\u set”中:
ruby\u xml\u html\u parser\u context.c:307:7:警告:变量'result'集但未使用[-Wunused但设置变量]
int结果;
^
编译ruby_xml_node.c
ruby_xml_node.c:在函数“rxml_node_to_s”中:
ruby_xml_node.c:585:54:错误:取消对不完整类型的指针的引用
结果=rxml\u new\u cstr((const char*)输出->转换->内容,编码);
^
ruby_xml_node.c:587:56:错误:取消对不完整类型的指针引用
结果=rxml\u new\u cstr((const char*)输出->缓冲区->内容,Xencode);
^
make:**[ruby\u xml\u node.o]错误1
make失败,退出代码2
Gem文件仍将安装在/home/camillavk/.rvm/gems/ruby-2.1.5/gems/libxml-ruby-2.2.2中以供检查。
结果记录到/home/camillavk/.rvm/gems/ruby-2.1.5/extensions/x86_64-linux/2.1.0/libxml-ruby-2.2.2/gem_make.out
我在linux上运行这个->有人知道我如何解决这个问题或修复它吗


谢谢

这看起来很像libxml ruby。您系统上的libxml2版本可能太新,无法与您尝试安装的libxmlruby版本配合使用。我同意我系统上的libxml2版本似乎太新,无法与我尝试安装的版本配合使用,但我不知道如何强制我的系统使用旧版本…我尝试了链接中的内容您发送了,但没有改变任何内容……您可以将Rails项目升级到libxml ruby 2.4.0(修复此问题的版本)吗?看起来2.2.2和2.4.0之间没有任何中断。谢谢@PhilRoss,这解决了问题
Building native extensions.  This could take a while...
ERROR:  Error installing libxml-ruby:
        ERROR: Failed to build gem native extension.

    /home/camillavk/.rvm/rubies/ruby-2.1.5/bin/ruby -r ./siteconf20150122-7254-1rcd0x0.rb extconf.rb
extconf.rb:17:in `<main>': Use RbConfig instead of obsolete and deprecated Config.
extconf.rb:17:in `<main>': Use RbConfig instead of obsolete and deprecated Config.
checking for socket() in -lsocket... no
checking for gethostbyname() in -lnsl... yes
checking for atan() in -lm... yes
checking for inflate() in -lz... yes
checking for iconv_open() in -liconv... no
checking for libiconv_open() in -liconv... no
checking for libiconv_open() in -llibiconv... no
checking for iconv_open() in -llibiconv... no
checking for iconv_open() in -lc... yes
checking for xmlParseDoc() in -lxml2... yes
checking for libxml/xmlversion.h... no
checking for libxml/xmlversion.h in /opt/include/libxml2,/usr/local/include/libxml2,/usr/include/libxml2... yes
creating extconf.h
creating Makefile

make "DESTDIR=" clean

make "DESTDIR="
compiling ruby_xml_html_parser_options.c
compiling ruby_xml_cbg.c
compiling ruby_xml_html_parser.c
compiling ruby_xml_relaxng.c
compiling ruby_xml_schema.c
compiling ruby_xml_xpath_expression.c
compiling ruby_xml_parser.c
compiling ruby_xml_io.c
compiling ruby_xml_error.c
compiling ruby_xml_html_parser_context.c
ruby_xml_html_parser_context.c: In function ‘rxml_html_parser_context_options_set’:
ruby_xml_html_parser_context.c:307:7: warning: variable ‘result’ set but not used [-Wunused-but-set-variable]
   int result;
       ^
compiling ruby_xml_node.c
ruby_xml_node.c: In function ‘rxml_node_to_s’:
ruby_xml_node.c:585:54: error: dereferencing pointer to incomplete type
     result = rxml_new_cstr((const char*) output->conv->content, xencoding);
                                                      ^
ruby_xml_node.c:587:56: error: dereferencing pointer to incomplete type
     result = rxml_new_cstr((const char*) output->buffer->content, xencoding);
                                                        ^
make: *** [ruby_xml_node.o] Error 1

make failed, exit code 2

Gem files will remain installed in /home/camillavk/.rvm/gems/ruby-2.1.5/gems/libxml-ruby-2.2.2 for inspection.
Results logged to /home/camillavk/.rvm/gems/ruby-2.1.5/extensions/x86_64-linux/2.1.0/libxml-ruby-2.2.2/gem_make.out