Nokogiri gem安装在Capistrano部署中失败 [英] Nokogiri gem install failing in Capistrano deploy

查看:78
本文介绍了Nokogiri gem安装在Capistrano部署中失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

尝试通过捆绑器/ capistrano安装Nokogiri时收到错误:

When attempting to install Nokogiri via bundler/capistrano I am receiving the error:

An error occurred while installing nokogiri (1.6.5), and Bundler cannot continue

深入挖掘,我可以看到>> libxml2版本2.6需要.21或更高版本!

Digging deeper I can see >> libxml2 version 2.6.21 or later is required!

该错误消息还会显示,请确保gem install nokogiri -v'1.6.5'

好吧,如您所见,这不是问题:

Well, as you can see this is not a problem:

vagrant@vagrant:~$ gem install nokogiri -v '1.6.5'
Building native extensions.  This could take a while...
Successfully installed nokogiri-1.6.5
1 gem installed

遗憾的是,即使通过了此测试,cap部署仍然会失败,并出现相同的错误。

Sadly, even when this test is passed, the cap deploy still fails with the same error.

安装nokogiri(1.6.5)时发生错误,Bundler无法继续

我已经确保我的virtualbox上安装了最新版本的libxml2。我什至删除了我的项目目录,然后重新启动了服务器:

I have I have ensured the latest version of libxml2 is installed on my virtualbox. I even removed my project directory, and rebooted the server:

$ vagrant ssh
$ sudo apt-get update
$ sudo apt-get upgrade libxml2
$ sudo rm -rf /var/www/rails-devise-capistrano/
$ sudo reboot

我也尝试将其添加到deploy.rb

I have also tried added this to deploy.rb

set :bundle_env_variables, { nokogiri_use_system_libraries: 1 }

这里是捆包错误

/home/vagrant/.rbenv/versions/2.2.2/bin/ruby -r ./siteconf20150704-1327-1yf3b95.rb extconf.rb
checking if the C compiler accepts ... yes
Building nokogiri using system libraries.
libxml2 version 2.6.21 or later is required!
*** 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
        --without-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=/home/vagrant/.rbenv/versions/2.2.2/bin/$(RUBY_BASE_NAME)
        --help
        --clean
        --use-system-libraries=true
        --with-zlib-dir
        --without-zlib-dir
        --with-zlib-include
        --without-zlib-include=${zlib-dir}/include
        --with-zlib-lib
        --without-zlib-lib=${zlib-dir}/lib
        --with-xml2-dir
        --without-xml2-dir
        --with-xml2-include
        --without-xml2-include=${xml2-dir}/include
        --with-xml2-lib
        --without-xml2-lib=${xml2-dir}/lib
        --with-libxml-2.0-config
        --without-libxml-2.0-config
        --with-pkg-config
        --without-pkg-config
        --with-xslt-dir
        --without-xslt-dir
        --with-xslt-include
        --without-xslt-include=${xslt-dir}/include
        --with-xslt-lib
        --without-xslt-lib=${xslt-dir}/lib
        --with-libxslt-config
        --without-libxslt-config
        --with-pkg-config
        --without-pkg-config
        --with-exslt-dir
        --without-exslt-dir
        --with-exslt-include
        --without-exslt-include=${exslt-dir}/include
        --with-exslt-lib
        --without-exslt-lib=${exslt-dir}/lib
        --with-libexslt-config
        --without-libexslt-config
        --with-pkg-config
        --without-pkg-config

extconf failed, exit code 1


推荐答案

我遇到了同样的问题,尝试了很多选择,但是我需要的是这两个库: / p>

I had the same problem and tried a lot of options but what I needed were these two libraries:

libxml2-devel
libxslt-devel

问题是输出总是提到 libxml2 ,但是所需的内容似乎在开发库中。 (我不是很喜欢图书馆和其他东西,所以我不能确切地说出问题是什么。)我使用Cent OS,所以它可能与您的设置有些不同(例如 libxml2-dev libxslt1-开发)。

The thing is the output always mentioned libxml2 but the needed stuff seemed to be in the development library. (I'm not really into libraries and stuff so I can't tell exactly what the porblem was.) I use Cent OS so maybe its a bit different with your setup (something like libxml2-dev libxslt1-dev).

这篇关于Nokogiri gem安装在Capistrano部署中失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆