当前位置:  开发笔记 > 后端 > 正文

libxml-ruby无法在x86_64加载

如何解决《libxml-ruby无法在x86_64加载》经验,为你挑选了2个好方法。

我们在服务器端遇到libxml-ruby gem问题可能因为它使用了x86_64架构:

$ uname -a Linux ip-10-228-171-64 2.6.21.7-2.fc8xen-ec2-v1.0#1 SMP Tue Sep 1 10:25:30 EDT 2009 x86_64 GNU/Linux

require 'libxml'
LoadError: /usr/local/ruby-enterprise/lib/ruby/gems/1.8/gems/libxml-ruby-1.1.4/lib/libxml_ruby.so: invalid ELF header - /usr/local/ruby-enterprise/lib/ruby/gems/1.8/gems/libxml-ruby-1.1.4/lib/libxml_ruby.so
from /usr/local/ruby-enterprise/lib/ruby/gems/1.8/gems/libxml-ruby-1.1.4/lib/libxml_ruby.so
from /usr/local/ruby-enterprise/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
from /usr/local/ruby-enterprise/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:156:in `require'
from /usr/local/ruby-enterprise/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:521:in `new_constants_in'
from /usr/local/ruby-enterprise/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:156:in `require'
from /usr/local/ruby-enterprise/lib/ruby/gems/1.8/gems/libxml-ruby-1.1.4/lib/libxml.rb:9
from /usr/local/ruby-enterprise/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
from /usr/local/ruby-enterprise/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
from /usr/local/ruby-enterprise/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:156:in `require'
from /usr/local/ruby-enterprise/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:521:in `new_constants_in'
from /usr/local/ruby-enterprise/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:156:in `require'
from (irb):1

宝石版1.1.4

重新安装宝石没有帮助可以有人建议做什么?



1> jalagrange..:

我在Centos中遇到了同样的问题....显然宝石版1.1.4和64位机器存在问题.前往rubyfourge并下载1.1.3版本.

http://rubyforge.org/frs/?group_id=494

下载.gem然后运行:

gem install libxml-ruby-1.1.3.gem

在控制台上.我希望这有帮助



2> 小智..:

为了它的价值,我在ubuntu中遇到了同样的问题,并且有效的是安装了libxml开发包,详见此处

对于Ubuntu,使用apt-get而不是yum:%sudo apt-get install libxml2-dev

然后安装libxml-ruby gem就像魅力一样.

推荐阅读
小白也坚强_177
这个屌丝很懒,什么也没留下!
DevBox开发工具箱 | 专业的在线开发工具网站    京公网安备 11010802040832号  |  京ICP备19059560号-6
Copyright © 1998 - 2020 DevBox.CN. All Rights Reserved devBox.cn 开发工具箱 版权所有