我已经编写了简单的配方,这里是在节点中创建一个目录。但它运行厨师客户端时显示错误。无法在节点中创建目录
目录 “〜/编译” 做
行动:建立
末
* Parent directory ~ does not exist, cannot create ~/build
================================================================================
Error executing action `create` on resource 'directory[~/build]'
================================================================================
Chef::Exceptions::EnclosingDirectoryDoesNotExist
------------------------------------------------
Parent directory ~ does not exist, cannot create ~/build
感谢您的宝贵意见。
它〜因为〜符号。我认为你需要使用..而不是那 – qamar
,但通常可以使用此命令使目录:mkdir〜/ build为什么不在厨师? – VVijay
因为'〜'是$ HOME的* shell *快捷键。 Ruby对'〜'没有特殊的含义,所以用'$ HOME'代替它,它会在运行chef的用户的home(通常是root)中创建目录。 – Tensibai