【问题标题】:Nokogiri / Fog not installing on AWS OpsWorks Chef 11Nokogiri / Fog 未安装在 AWS OpsWorks Chef 11 上
【发布时间】:2017-01-30 02:49:52
【问题描述】:

我们用于启动 EC2 实例的 OpsWork Chef 脚本已停止工作。

我对日志文件的解释,摘录如下,Route53 正在尝试使用 Fog,但 Fog 无法安装,因为 Nokogiri 需要 Ruby 2.1.0 或更高版本。

经过一些 Google 搜索后,我发现 Ruby 的版本与 OpsWork 版本并列,而我们使用的 Chef 11 是 Ruby 2.0。

我不明白的是我们在 Nokogirl 上有固定版本

gem_package "nokogiri" do
  action :install
  version "1.5.11"
end

去年运行的所有 Chef 脚本,所以我猜在 Nokogiri 或 Fog 中发生了一些变化。任何帮助将不胜感激。

From log...
[2017-01-30T09:29:48+10:00] INFO: Processing package[autoconf] action nothing (build-essential::_debian line 108)
[2017-01-30T09:29:48+10:00] INFO: Processing package[binutils-doc] action nothing (build-essential::_debian line 108)
[2017-01-30T09:29:48+10:00] INFO: Processing package[bison] action nothing (build-essential::_debian line 108)
[2017-01-30T09:29:48+10:00] INFO: Processing package[build-essential] action nothing (build-essential::_debian line 108)
[2017-01-30T09:29:48+10:00] INFO: Processing package[flex] action nothing (build-essential::_debian line 108)
[2017-01-30T09:29:48+10:00] INFO: Processing package[gettext] action nothing (build-essential::_debian line 108)
[2017-01-30T09:29:48+10:00] INFO: Processing package[ncurses-dev] action nothing (build-essential::_debian line 108)
[2017-01-30T09:29:48+10:00] INFO: Processing package[libxml2-dev] action nothing (route53::default line 23)
[2017-01-30T09:29:48+10:00] INFO: Processing package[libxslt1-dev] action nothing (route53::default line 28)
[2017-01-30T09:29:48+10:00] INFO: Processing chef_gem[fog] action install (route53::default line 44)
[2017-01-30T09:29:48+10:00] INFO: Installing chef-gem fog = 1.20
ERROR:  Error installing fog:
nokogiri requires Ruby version >= 2.1.0.
[2017-01-30T09:29:55+10:00] INFO: 
[2017-01-30T09:29:55+10:00] INFO: Processing route53_record[fresno.servers.digitaldealer.com.au] action create (digitaldealer::adddns line 4)

================================================================================
Error executing action `create` on resource 'route53_record[fresno.servers.digitaldealer.com.au]'
================================================================================


LoadError
---------
cannot load such file -- fog/aws/dns


Cookbook Trace:
---------------
/var/lib/aws/opsworks/cache.stage2/cookbooks/route53/providers/record.rb:3:in `require'
/var/lib/aws/opsworks/cache.stage2/cookbooks/route53/providers/record.rb:3:in `block in class_from_file'

【问题讨论】:

    标签: ruby chef-infra nokogiri fog


    【解决方案1】:

    在 chef 运行期间安装可用的 gem 时,您应该使用 chef_gem 资源(因为它被 route53::default 使用)。

    chef_gem "nokogiri" do
      action :install
      version "1.5.11"
    end
    

    确保它在route53::default之前执行。

    【讨论】:

      猜你喜欢
      • 2017-06-17
      • 2021-10-20
      • 2021-10-22
      • 2021-02-25
      • 2020-10-23
      • 2016-03-01
      • 2016-05-28
      • 2020-10-08
      • 2015-01-31
      相关资源
      最近更新 更多