使用厨师生成食谱生成食谱时出错

时间:2017-04-28 01:41:13

标签: chef

我是厨师和学习的新手。我在生成烹饪书时遇到以下错误。我按照以下步骤操作。请告诉我进一步的步骤。

root@ip-IPAddress:/home/ubuntu/chef-repo/cookbooks# chef generate cookbook webserver
Command 'chef' is available in '/usr/games/chef'
The command could not be located because '/usr/games' is not included in the PATH environment variable.
chef: command not found

根据建议,我添加了这个。

root@ip-172-31-7-14:/home/ubuntu/chef-repo/cookbooks# export PATH="/usr/games:$PATH"
root@ip-172-31-7-14:/home/ubuntu/chef-repo/cookbooks# chef generate cookbook webserver
Can't open generate: No such file or directory.
Can't open cookbook: No such file or directory.
Can't open webserver: No such file or directory.

1 个答案:

答案 0 :(得分:1)

您的操作系统似乎是Ubuntu,我尝试按照以下步骤在我的ubuntu VPS上安装chef,效果很好:

  1. 下载Chef开发工具包:https://downloads.chef.io/chefdk/

    $ wget https://packages.chef.io/files/stable/chefdk/1.3.43/ubuntu/16.04/chefdk_1.3.43-1_amd64.deb
    
  2. 安装软件包,PATH将自动设置,

    root@Mc:~# dpkg -i chef-server*
    
    root@Mc:~# chef
    chef         chef-apply   chef-client  chef-shell   chef-solo    chef-vault
    
    root@Mc:~# chef -v
    Chef Development Kit Version: 1.3.43
    chef-client version: 12.19.36
    delivery version: master (dd319aa632c2f550c92a2172b9d1226478fea997)
    berks version: 5.6.4
    kitchen version: 1.16.0
    
  3. 生成食谱:

    $ chef generate app first_cookbook
    
  4. 您可以从chef docs查看更多详情。希望这会有所帮助。