刀烹饪网站安装麻烦

时间:2017-04-13 07:38:20

标签: chef

下载食谱时没问题。

PS> knife cookbook site download java_se
Downloading java_se from Supermarket at version 8.121.0 to D:/tools/chef-setupDevEnv/java_se-8.121.0.tar.gz
Cookbook saved: D:/tools/chef-setupDevEnv/java_se-8.121.0.tar.gz

然而,当我想安装食谱时,麻烦就出来了。

PS>knife cookbook site install java_se
Installing java_se to D:/tools/chef-setupDevEnv/chef-java_se
ERROR: The cookbook repo path D:/tools/chef-setupDevEnv/chef-java_se does not exist or is not a directory

我在chef blog上找到了

  

注意:如果收到错误“ERROR:IOError:无法打开或读取/Users/nshamrell/chef-repo/cookbooks/mysql/metadata.rb”,请检查您使用的刀具版本:   $ knife -v   如果它低于Chef:12.0.2,则需要更新你的Knife版本。但是,如果您使用Chef DK和rvm,请尝试运行此命令:   $ rvm use system

根据我的情况。

PS> knife -v
Chef: 12.19.36
PS>rvm use system
+ rvm use system
+ ~~~
+ CategoryInfo          : ObjectNotFound: (rvm:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException

当我在git bash上运行时

$ rvm use system
bash: rvm: command not found

这是否意味着我需要安装rvm?但是,我正在开发一个Windows工作站,这也是我选择厨师的原因。 现在有什么更好的解决方案?

我的knife.rb在D:\tools\chef-setupDevEnv\.chef

current_dir = File.dirname(__FILE__)
log_level                :info
log_location             STDOUT
node_name                "bro****ane"
client_key               "#{current_dir}/bro****ane.pem"
chef_server_url          "https://api.chef.io/organizations/tm****gy"
cookbook_path            ["#{current_dir}/../chef-java_se"]

1 个答案:

答案 0 :(得分:2)

当您运行knife cookbook site download时,您告诉刀在您调用它的当前目录中下载.tar.gz该cookbook。在这种情况下,它适合你。

然而,knife cookbook site install的工作方式不同。它假设你的knife.rbcookbook_path指向文件系统中的一个目录,这是一个厨师(和git)repo,至少有一个提交完成。就你在这里所写的内容而言,哪个你的情况。

您正在knife中调用D:/tools/chef-setupDevEnv/SomeDirectoryknife.rb告诉#{current_dir}/../chef-java_se D:/tools/chef-setupDevEnv/chef-java_se install,这可能不存在,如果是,它不是一个厨师/ git repo满足我在前一段中所述的条件。

downloadSub runPPT() Application.ScreenUpdating = False Dim wb As Workbook Set wb = ThisWorkbook Dim ws As Worksheet Set ws = wb.Sheets("SG2") Dim pptName As String Dim ppt As PowerPoint.Application Dim myPres As PowerPoint.Presentation Dim slds As PowerPoint.Slides Dim sld As PowerPoint.slide Dim oLayout As CustomLayout MsgBox ("Please choose PowerPoint to open.") pptName = openDialog() Set ppt = CreateObject("PowerPoint.Application") Set myPres = ppt.Presentations.Open(pptName) Set slds = myPres.Slides Set sld = slds.Add(myPres.Slides.Count + 1, ppLayoutBlank) For Each oLayout In myPres.Designs("Gate Main").SlideMaster.CustomLayouts If oLayout.Name = "Gate 2 Main" Then sld.CustomLayout = oLayout Exit For End If Next Application.ScreenUpdating = True End Sub Private Function openDialog() Dim fd As Office.FileDialog Dim txtFileName As String Set fd = Application.FileDialog(msoFileDialogFilePicker) With fd .AllowMultiSelect = False ' Set the title of the dialog box. .Title = "Please select the file." ' Clear out the current filters, and add our own. .Filters.Clear ' Show the dialog box. If the .Show method returns True, the ' user picked at least one file. If the .Show method returns ' False, the user clicked Cancel. If .Show = True Then txtFileName = .SelectedItems(1) 'replace txtFileName with your textbox End If End With openDialog = txtFileName End Function 的主要用途是控制您使用的食谱中的更改分支,您可以找到有关其优势的更多信息here