加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

ruby – 在主厨执行期间在本机扩展包之后安装gem

发布时间:2020-12-17 03:30:56 所属栏目:百科 来源:网络整理
导读:虽然在安装本机软件包之前安装了gem,但我尝试在大厨配方中安装雾gem,因此gem安装失败 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::upda
虽然在安装本机软件包之前安装了gem,但我尝试在大厨配方中安装雾gem,因此gem安装失败

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

我知道厨师资源的通知属性,但仍然可以正常运行.

那么我怎么能真正强制执行顺序首先安装本机包然后在同一个运行中安装gem.

注意:手动安装软件包不是一种选择,因为我们希望为新节点完全自动化.

解决方法

为什么不尝试在资源收集阶段开始时安装依赖项,如下所述: OPSCODE wiki: Run Resources from the Resource Collection

所以你的食谱看起来像:

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"

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读