berks install没有找到任何重写

时间:2014-10-13 17:18:27

标签: ruby windows git chef berkshelf

我使用的是安装了ChefDK 0.3.0-1的Windows 7 x64计算机,还安装了berkshelf和omnibus gems。我设置了我的Berksfile和metadata.rb文件

metadata.rb

depends 'users', '~> 1.7'
depends 'sudo', '~> 2.6'

Berksfile

cookbook 'users', git: 'https://github.com/sethvargo-cookbooks/users.git', rel: 'cookbooks/users', tag: 'v1.7.0'
cookbook 'sudo', git: 'https://github.com/opscode-cookbooks/sudo.git', rel: 'cookbooks/sudo', tag: 'v2.6.0'

我将系统环境变量中的环境变量设置为:

BERKSHELF_PATH=C:/

但是,当我发出命令时:

> berks install

我收到以下错误:

C:\c\c\cookbook_test> berks install
Resolving cookbook dependencies...
Fetching 'addm_setup' from source at .
Fetching 'sudo' from https://github.com/opscode-cookbooks/sudo.git (at v2.6.0/cookbooks/sudo)
Git error: command `git filter-branch --subdirectory-filter "cookbooks/sudo" --force` failed. If this error persists, try removing the cache directory at 'C:/chef/.cache/git/6f5ef5c786d127e1b549253a13b5d48c181aedeb'.Output from the command:

Found nothing to rewrite

我发现我不能使用Cygwin Git,因为我不知道该为它配置什么,以及git-scm的Git到目前为止工作。我也使用Windows命令提示符来执行这些命令。我不知道该怎么做,或者这是想告诉我的。

1 个答案:

答案 0 :(得分:0)

不幸的是,幸运的是,这是一个简单的答案。我收到了问题中列出的错误,因为我有

rel: 'cookbooks/sudo'

正在做的是寻找一个预先存在的存储库,但这并不存在。因此,一旦我将其删除,就会下载并包含烹饪书以供使用。

新结果是:

C:\c\c\cookbook_test> berks install
Resolving cookbook dependencies...
Fetching 'cookbook_test' from source at .
Fetching 'sudo' from https://github.com/opscode-cookbooks/sudo.git (at v2.6.0)
Fetching 'users' from https://github.com/sethvargo-cookbooks/users.git (at v1.7.0)
Fetching cookbook index from https://supermarket.getchef.com...
Using cookbook_test (0.1.0) from source at .
Using sudo (2.6.0) from https://github.com/opscode-cookbooks/sudo.git (at v2.6.0)
Using users (1.7.0) from https://github.com/sethvargo-cookbooks/users.git (at v1.7.0)