0

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

元数据.rb

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

伯克斯文件

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 命令提示符来执行这些命令。我不确定从这里做什么,或者这试图告诉我什么。

4

1 回答 1

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)
于 2014-10-13T18:31:52.067 回答