首页 > 解决方案 > 使用 chef-run 安装特定的 Ruby 版本

问题描述

我一直在尝试使用Chef Workstation及其包含的chef-runCLI 安装特定(最新)版本的 Ruby。

这是我用于 Ruby 的配方:

package 'ruby' do
  version '2.5.3'
  action :install
end

其中,使用命令行运行

chef-run -i /path-to/private_key user@host ruby.rb

产生不是很有帮助的消息:

[✔] Packaging cookbook... done!
[✔] Generating local policyfile... exporting... done!
[✖] Applying ruby from ruby.rb to target.
└── [✖] [127.0.0.1] Failed to converge ruby.

The converge of the remote host failed for the
following reason:

  Expected process to exit with [0], but received '100'

我试图用-V标志运行它,或者寻找一个日志文件,但我似乎找不到它。任何想法?

标签: rubychef-infrachef-workstation

解决方案


通过在chef-workstation 配置log_level中设置它来提高debug

$ cat ~/.chef-workstation/config.toml

[log]
level="debug"

推荐阅读