我们在 Rails 项目中有一个构建管道:我们在测试服务器中捆绑和测试应用程序,然后我们将它(带有 gem 的代码vendor/
)复制到登台服务器并将其部署到乘客服务器。
它曾经可以工作,但现在我在以下错误中得到apache.error.log
:
WARNING: Nokogiri was built against LibXML version 2.7.6, but has dynamically loaded 2.6.26
/usr/local/rvm/rubies/ruby-1.9.2-p318/bin/ruby:
relocation error: /home/project/vendor/bundle/ruby/1.9.1/gems/nokogiri-1.5.2/lib/nokogiri/nokogiri.so:
symbol xmlNextElementSibling, version LIBXML2_2.7.3 not defined in file libxml2.so.2 with link time reference
并error 500
在浏览器中。
当我在登台服务器上运行 webbrick 时,你会在第一次请求时遇到类似的错误。我该如何解决?
编辑:
与 nokogiri 版本的 Strange 事情。相同的二进制文件加载不同的 libxml 版本,具体取决于我是独立调用它还是使用bundle exec
:
vendor/bundle/ruby/1.9.1/gems/nokogiri-1.5.2/bin/nokogiri -v
# Nokogiri (1.5.2)
---
warnings: []
nokogiri: 1.5.2
ruby:
version: 1.9.2
platform: x86_64-linux
description: ruby 1.9.2p318 (2012-02-14 revision 34678) [x86_64-linux]
engine: ruby
libxml:
binding: extension
compiled: 2.6.26
loaded: 2.6.26
$ bundle exec vendor/bundle/ruby/1.9.1/gems/nokogiri-1.5.2/bin/nokogiri -v
WARNING: Nokogiri was built against LibXML version 2.7.6, but has dynamically loaded 2.6.26
# Nokogiri (1.5.2)
---
warnings:
- Nokogiri was built against LibXML version 2.7.6, but has dynamically loaded 2.6.26
nokogiri: 1.5.2
ruby:
version: 1.9.2
platform: x86_64-linux
description: ruby 1.9.2p318 (2012-02-14 revision 34678) [x86_64-linux]
engine: ruby
libxml:
binding: extension
compiled: 2.7.6
loaded: 2.6.26