我们在服务器端遇到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
重新安装宝石没有帮助可以有人建议做什么?
我在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
在控制台上.我希望这有帮助
为了它的价值,我在ubuntu中遇到了同样的问题,并且有效的是安装了libxml开发包,详见此处
对于Ubuntu,使用apt-get而不是yum:%sudo apt-get install libxml2-dev
然后安装libxml-ruby gem就像魅力一样.