我正在尝试在厨师中执行推送工作,但我收到以下错误。 试图安装所需的宝石,但仍然是错误。
[root@chefserver chef-repo]# knife node status
devapp1 available
[root@chefserver chef-repo]# knife job start uptime devapp1
/opt/chefdk/embedded/lib/ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file -- chef/rest (LoadError)
from /opt/chefdk/embedded/lib/ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /opt/chefdk/embedded/lib/ruby/gems/2.4.0/gems/knife-push-1.0.2/lib/chef/knife/job_start.rb:27:in `block in <class:JobStart>'
from /opt/chefdk/embedded/lib/ruby/gems/2.4.0/gems/chef-13.2.20/lib/chef/knife.rb:232:in `block in load_deps'
from /opt/chefdk/embedded/lib/ruby/gems/2.4.0/gems/chef-13.2.20/lib/chef/knife.rb:231:in `each'
from /opt/chefdk/embedded/lib/ruby/gems/2.4.0/gems/chef-13.2.20/lib/chef/knife.rb:231:in `load_deps'
from /opt/chefdk/embedded/lib/ruby/gems/2.4.0/gems/chef-13.2.20/lib/chef/knife.rb:216:in `run'
from /opt/chefdk/embedded/lib/ruby/gems/2.4.0/gems/chef-13.2.20/lib/chef/application/knife.rb:156:in `run'
from /opt/chefdk/embedded/lib/ruby/gems/2.4.0/gems/chef-13.2.20/bin/knife:25:in `<top (required)>'
from /bin/knife:263:in `load'
from /bin/knife:263:in `<main>'
[root@chefserver chef-repo]# chef gem list |grep rest
rest (3.0.8)
stuartpreston-azure-sdk-for-ruby (0.7.2)
[root@chefserver chef-repo]#
答案 0 :(得分:0)
在几天内在其他服务器上成功测试推送作业后,我自己收到了此错误。看来这是在chef-client 13.x
上引入的一个错误。但是,我没有在他们的跟踪器上找到任何错误报告。
我正在使用chef-13.0.118-1
并降级为chef-12.20.3-1
),它立刻就可以使用了:
$ knife job start teste nodetest --capture
Started. Job ID: fa5f210d826e112b335abce48b1a27b7
.Complete.
capture_output: true
command: teste
created_at: Mon, 31 Jul 2017 20:45:15 GMT
env:
id: fa5f210d826e112b335abce48b1a27b7
nodes:
failed: nodetest
run_timeout: 3600
status: complete
updated_at: Mon, 31 Jul 2017 20:45:15 GMT