5

このエラーを解決するにはどうすればよいですか? chef-soloWindows を使用していなくても、非常に単純なnode.json構成ファイルで実行すると発生します。

$ chef-solo -c solo.rb -j node.json
...
[Sun, 06 Nov 2011 13:21:03 +0000] FATAL: LoadError: no such file to load -- win32/open3

solo.rbは:

file_cache_path "/usr/local/var/chef-solo"
cookbook_path "/home/mjs/workspace/cookbooks"

node.jsonは:

{ "run_list": [ "recipe[greeting]" ] }
4

3 に答える 3

8

Opscode では、クックブック リポジトリ全体を複製するのではなく(この理由やその他の理由から)、必要なクックブックを Chef コミュニティ サイトからダウンロードすることをお勧めします。

主に、そのリポジトリは開発中であり、個々のクックブックはコミュニティ サイトでリリースされています。さらに、すべてのクックブックが Chef Solo 用に最適化されているわけではなく、Chef Solo で動作するわけでもありません。Cookbooks リポジトリの最新の README.md も、これをかなり明確にするはずです。

http://wiki.opscode.com/display/chef/Cookbooks http://www.opscode.com/blog/2011/05/05/future-of-opscode-cookbooks/ http://community.opscode.com /

于 2011-11-22T07:09:39.637 に答える
3

私の場合、これは/home/mjs/workspace/cookbooksすべての opscode のクックブックが含まれていることが原因でした。(つまり、私は彼らのレポを複製し、新しいクックブックを追加していました。) ランリストが私のレシピのみを指定しているにもかかわらず、chef はディレクトリ内の他のクックブックに何かをしているようです。関連する gem がインストールされます。

于 2011-11-06T13:33:55.513 に答える
1

chef loads all the cookbooks in the cookbook path, and uses recipes that are listed on the run_list. Because chef-solo is loading all of the cookbooks in the path, and not just the ones it downloads, like chef-client does, most of the time it loads (as in, includes the ruby script) stuff that you didn't mean for it to load.

For me it happened on the windows cookbook when I tested some recipe with Vagrant. I just commented out the require line, as a work-around.

For testing recipes with chef-solo, I hold a git branch with a few commits that avoid these problems. Since these commits are usually small and are not related to the recipes I'm testing but just to make sure chef-solo is running, this is enough to work-around such issues.

于 2012-06-05T13:44:38.973 に答える