厨师在执行过程中安装本地扩展包后的宝石(Installing a gem after native

2019-08-17 13:56发布

我试图安装雾宝石厨师食谱虽然发生在创业板安装正在安装本地软件包之前,所以创业板的安装失败

package "libxslt-dev"
package "libxml2-dev"

chef_gem "fog"

这是输出

[Thu, 14 Mar 2013 13:04:30 +0000] INFO: Processing chef_gem[fog] action install (ebs4000::update_volumes line 23)
[Thu, 14 Mar 2013 13:04:52 +0000] ERROR: Running exception handlers
[Thu, 14 Mar 2013 13:04:52 +0000] FATAL: Saving node information to /var/cache/chef/failed-run-data.json
[Thu, 14 Mar 2013 13:04:52 +0000] ERROR: Exception handlers complete
[Thu, 14 Mar 2013 13:04:52 +0000] ERROR: Gem::Installer::ExtensionBuildError: chef_gem[fog] (cookbook::recipe line 4) had an error: Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.

        /usr/bin/ruby1.8 extconf.rb
checking for libxml/parser.h... no
-----
libxml2 is missing.  please visit http://nokogiri.org/tutorials/installing_nokogiri.html for help with installing dependencies.
-----
*** 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-pkg-config
    --without-pkg-config


Gem files will remain installed in /var/lib/gems/1.8/gems/nokogiri-1.5.6 for inspection.
Results logged to /var/lib/gems/1.8/gems/nokogiri-1.5.6/ext/nokogiri/gem_make.out

我知道厨师的资源的通知属性,但仍可以正常得到这个运行。

因此,如何能我居然强制执行顺序,先安装本地程序包,然后将宝石在相同的运行。

注:包手动安装是不是一种选择,因为我们想要一个完全自动化的新节点。

Answer 1:

为什么不尝试在资源收集阶段的开始安装的依赖关系,这里提到: Opscode公司维基:运行资源从资源集合

所以,你的食谱看起来像:

xsltdev = package "libxslt-dev" do
   action :nothing
end

xmldev = package "libxml2-dev" do
   action :nothing
end

xsltdev.run_action(:install)
xmldev.run_action(:install)

chef_gem "fog"


Answer 2:

好像你已经这样做。 配方是按顺序执行,所以你应该不错。

在你的日志,你只显示从那里厨师试图安装点发生了什么fog 。 您是否已经验证了lib包安装并不在此之前来了? 你可能得到错误的包名,或者您需要之前更新软件包管理器的缓存。



文章来源: Installing a gem after native extension packages during chef execution