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