ruby - vagrant-berkshelf 插件编译(安装)报错

标签 ruby rubygems chef-infra vagrant berkshelf

附上我的控制台片段:

发布版本:

$ sudo cat /etc/*release* | grep -i distrib
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=13.10
DISTRIB_CODENAME=saucy
DISTRIB_DESCRIPTION="Ubuntu 13.10"

ruby 版本:

$ ruby --version
ruby 2.0.0p299 (2013-08-29) [x86_64-linux-gnu]

Vagrant 版本:

$ vagrant --version
Vagrant 1.3.5

先决条件:

$ sudo dpkg -s libxml2 libxml2-dev libxslt1-dev libxslt1.1 build-essential | grep -i status
Status: install ok installed
Status: install ok installed
Status: install ok installed
Status: install ok installed
Status: install ok installed

当我尝试安装 vagrant-berkshelf 插件时,我收到以下错误:

$ sudo vagrant plugin install vagrant-berkshelf --plugin-version 1.3.4
Installing the 'vagrant-berkshelf --version '1.3.4'' plugin. This can take a few minutes...
/opt/vagrant/embedded/lib/ruby/1.9.1/rubygems/installer.rb:562:in `rescue in block in build_extensions': ERROR: Failed to build gem native extension. (Gem::Installer::ExtensionBuildError)

        /opt/vagrant/embedded/bin/ruby extconf.rb
Extracting libxml2-2.8.0.tar.gz into tmp/x86_64-linux-gnu/ports/libxml2/2.8.0... OK
Running 'configure' for libxml2 2.8.0... OK
Running 'compile' for libxml2 2.8.0... ERROR, review 'tmp/x86_64-linux-gnu/ports/libxml2/2.8.0/compile.log' to see what happened.
*** 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
    --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=/opt/vagrant/embedded/bin/ruby
/home/user/.vagrant.d/gems/gems/mini_portile-0.5.2/lib/mini_portile.rb:265:in `block in execute': Failed to complete compile task (RuntimeError)
    from /home/user/.vagrant.d/gems/gems/mini_portile-0.5.2/lib/mini_portile.rb:257:in `chdir'
    from /home/user/.vagrant.d/gems/gems/mini_portile-0.5.2/lib/mini_portile.rb:257:in `execute'
    from /home/user/.vagrant.d/gems/gems/mini_portile-0.5.2/lib/mini_portile.rb:69:in `compile'
    from /home/user/.vagrant.d/gems/gems/mini_portile-0.5.2/lib/mini_portile.rb:109:in `cook'
    from extconf.rb:101:in `block in <main>'
    from extconf.rb:119:in `call'
    from extconf.rb:119:in `block in <main>'
    from extconf.rb:109:in `tap'
    from extconf.rb:109:in `<main>'


Gem files will remain installed in /home/user/.vagrant.d/gems/gems/nokogiri-1.6.0 for inspection.
Results logged to /home/user/.vagrant.d/gems/gems/nokogiri-1.6.0/ext/nokogiri/gem_make.out
    from /opt/vagrant/embedded/lib/ruby/1.9.1/rubygems/installer.rb:540:in `block in build_extensions'
    from /opt/vagrant/embedded/lib/ruby/1.9.1/rubygems/installer.rb:515:in `each'
    from /opt/vagrant/embedded/lib/ruby/1.9.1/rubygems/installer.rb:515:in `build_extensions'
    from /opt/vagrant/embedded/lib/ruby/1.9.1/rubygems/installer.rb:180:in `install'
    from /opt/vagrant/embedded/lib/ruby/1.9.1/rubygems/dependency_installer.rb:297:in `block in install'
    from /opt/vagrant/embedded/lib/ruby/1.9.1/rubygems/dependency_installer.rb:270:in `each'
    from /opt/vagrant/embedded/lib/ruby/1.9.1/rubygems/dependency_installer.rb:270:in `each_with_index'
    from /opt/vagrant/embedded/lib/ruby/1.9.1/rubygems/dependency_installer.rb:270:in `install'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.3.5/plugins/commands/plugin/action/install_gem.rb:49:in `block in call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.3.5/plugins/commands/plugin/gem_helper.rb:42:in `block in with_environment'
    from /opt/vagrant/embedded/lib/ruby/1.9.1/rubygems/user_interaction.rb:40:in `use_ui'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.3.5/plugins/commands/plugin/gem_helper.rb:41:in `with_environment'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.3.5/plugins/commands/plugin/action/install_gem.rb:39:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/action/warden.rb:34:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.3.5/plugins/commands/plugin/action/bundler_check.rb:20:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/action/warden.rb:34:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/action/builder.rb:116:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/action/runner.rb:61:in `block in run'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/util/busy.rb:19:in `busy'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/action/runner.rb:61:in `run'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.3.5/plugins/commands/plugin/command/base.rb:17:in `action'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.3.5/plugins/commands/plugin/command/install.rb:27:in `execute'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.3.5/plugins/commands/plugin/command/root.rb:52:in `execute'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/cli.rb:38:in `execute'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/environment.rb:478:in `cli'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.3.5/bin/vagrant:96:in `<top (required)>'
    from /opt/vagrant/bin/../embedded/gems/bin/vagrant:23:in `load'
    from /opt/vagrant/bin/../embedded/gems/bin/vagrant:23:in `<main>'

谁能帮我解决这个问题

更新: vagrant-berkshelf 版本 1.3.x、1.2.0 甚至没有明确指定版本时也会出现同样的错误。

最佳答案

$ NOKOGIRI_USE_SYSTEM_LIBRARIES=1 vagrant plugin install vagrant-berkshelf

Source

关于ruby - vagrant-berkshelf 插件编译(安装)报错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19985303/

相关文章:

ruby - 如何在 Ruby 应用程序中卡住 gem?

azure - Chef WebPI 说明书在 Azure 中安装失败

ruby-on-rails - 自从从 rails 3 升级到 rails 4 后,rails 4 中的模态( Bootstrap )现在无法正常工作

ruby - 警告 : RubyGems 1. 找不到 2+ 索引:RubyGems 将恢复到降低性能的旧索引

ruby - 安装成功后无法运行sass

Ruby 无法连接到 ruby​​gems.org

ruby-on-rails - 使用 'taps' gem 在 Windows 上将 SQLite3 迁移到 PostgreSQL 时出现 CantOpenException

ruby-on-rails - Rails ActiveAdmin,表单页面上的两列(不是边栏)

chef-infra - 尝试上传 Recipe 后, Chef Knife 因关键错误而失败

Java 社区 Recipe 有点用吗?