【问题标题】:bundle/gemfile error installing knife-ec2 plugin安装knife-ec2插件的bundle/gemfile错误
【发布时间】:2014-02-12 21:37:57
【问题描述】:

我不是 ruby​​ 人,正在尝试为 Chef 安装 knife-ec2 插件,关注 the steps here

在我做之前一切都很好

$ bundle install --path vendor

产生以下错误:

Fetching gem metadata from https://rubygems.org/.......
Fetching gem metadata from https://rubygems.org/..
Installing i18n (0.6.9)
Installing multi_json (1.8.4)
Installing activesupport (3.2.16)
Installing addressable (2.3.5)
Installing builder (3.2.2)
Installing gyoku (1.1.1)
Installing mini_portile (0.5.2)
Installing nokogiri (1.6.1) with native extensions
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension
.

        /opt/chef/embedded/bin/ruby extconf.rb
Extracting libxml2-2.8.0.tar.gz into tmp//ports/libxml2/2.8.0... OK
Running 'configure' for libxml2 2.8.0... ERROR, review 'tmp//ports/libxml2/2.8.0
/configure.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/chef/embedded/bin/ruby
/home/ubuntu/chef-repo/.chef/vendor/ruby/1.9.1/gems/mini_portile-0.5.2/lib/mini_
portile.rb:265:in `block in execute': Failed to complete configure task (Runtime
Error)
        from /home/ubuntu/chef-repo/.chef/vendor/ruby/1.9.1/gems/mini_portile-0.
5.2/lib/mini_portile.rb:257:in `chdir'
        from /home/ubuntu/chef-repo/.chef/vendor/ruby/1.9.1/gems/mini_portile-0.
5.2/lib/mini_portile.rb:257:in `execute'
        from /home/ubuntu/chef-repo/.chef/vendor/ruby/1.9.1/gems/mini_portile-0.
5.2/lib/mini_portile.rb:65:in `configure'
        from /home/ubuntu/chef-repo/.chef/vendor/ruby/1.9.1/gems/mini_portile-0.
5.2/lib/mini_portile.rb:108: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/ubuntu/chef-repo/.chef/vendor/ruby/1.9.
1/gems/nokogiri-1.6.1 for inspection.
Results logged to /home/ubuntu/chef-repo/.chef/vendor/ruby/1.9.1/gems/nokogiri-1
.6.1/ext/nokogiri/gem_make.out
An error occured while installing nokogiri (1.6.1), and Bundler cannot continue.

Make sure that `gem install nokogiri -v '1.6.1'` succeeds before bundling.

如果发布其他文件或控制台输出有帮助,请告诉我。

【问题讨论】:

  • 我冒昧地嵌入了您链接到的文本。在实际情况下,SO 倾向于将所需的一切都放在问题本身中。更方便读者;此外,链接可能会变坏。
  • 谢谢韦恩康拉德。我实际上尝试使用 4 个空格缩进来做到这一点,但由于其他更深的缩进,它对我来说并不奏效。介意分享一下你是怎么做到的吗?
  • 纳米。粘贴到记事本++中,点击一次tab,再次cnp,修复。谢谢

标签: ruby rubygems bundler chef-infra knife


【解决方案1】:

您需要安装 libxml。 stacktrace 显示你在 Ubuntu 上,所以:

sudo apt-get install libxml2

请参阅Nokogiri readme 了解更多信息。

【讨论】:

  • 会尝试一下。我认为使用 gemfile 和 bundle 的目的是避免依赖问题?
  • libxml2 安装没有任何问题,但 nokogiri 仍然给出完全相同的错误。 pastebin.com/AHv98wKk
  • 你也安装了 libxslt 吗? stackoverflow.com/questions/20890808/…
  • 是的,先生。 sudo apt-get install libxml2-dev libxslt-dev ruby​​1.9.1 ruby​​1.9.1-dev (个别不是一次)全部完成,没有问题。仍然收到 nokogiri 安装错误。 (由于评论长度限制,无法内嵌粘贴)pastebin.com/CyfcKswM
  • 您使用的是综合 Ruby 吗?那个 Ruby 是专为 Chef 准备的。您需要安装自己的 Ruby。
猜你喜欢
  • 2023-04-06
  • 1970-01-01
  • 2014-03-09
  • 2015-04-22
  • 2011-10-27
  • 1970-01-01
  • 2018-01-16
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多