Chef infra 无法使用刀子命令上载食谱

Chef infra 无法使用刀子命令上载食谱,chef-infra,knife,cookbook,Chef Infra,Knife,Cookbook,在Windows中,无法将cookbook上载到托管的chef服务器。我的Knife.rd文件: # See http://docs.chef.io/config_rb_knife.html for more information on knife configuration options current_dir = File.dirname(__FILE__) log_level :info log_location STDOUT no

在Windows中,无法将cookbook上载到托管的chef服务器。我的Knife.rd文件:

# See http://docs.chef.io/config_rb_knife.html for more information on knife configuration options
current_dir = File.dirname(__FILE__)
log_level                :info
log_location             STDOUT
node_name                "xxxxx"
client_key               "#{current_dir}/xxxxx.pem"
validation_client_name   "wis-validator"
validation_key           "#{current_dir}/wis-validator.pem"
chef_server_url          "https://api.chef.io/organizations/xxxx"
cookbook_path            ["#{current_dir}/../cookbooks/"]
当我运行
knife upload learn\u chef\u apache2
命令时,会看到下面的错误消息

错误:当前时尝试使用相对路径“learn\u chef\u apache2” 目录位于存储库路径之外。错误:当前正在工作 目录是“E:/Prasanna\u POC/learn\u chef”


我正在从cookbooks文件夹所在的路径和learn\u chef\u apache2 cookbook present中运行刀子上传命令,我想您的意思是运行
刀子cookbook upload learn\u chef\u apache2
knife upload
命令更通用,可以上载多种类型的内容,但您需要为其指定对象的路径。

当您运行命令:
knife upload learn\u chef\u apache2
时,必须确保您的
cookbook路径中有cookbook
learn\u chef\u apache2

cookbook\u路径
设置在
knife.rb
文件中

cookbook_path            ["#{current_dir}/../cookbooks/"]

请确认这是:
knife.rb
不是
knife.rd

您的.chef目录在哪里?