Question

How can I resolve this error? I get it when running chef-solo with a very simple node.json and configuration file, even though I'm not using Windows.

$ 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 is:

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

node.json is:

{ "run_list": [ "recipe[greeting]" ] }
Was it helpful?

Solution

Opscode recommends that you not clone the entire cookbooks repository (for this reason and others), and instead download the cookbooks you need from the Chef Community site.

Mainly, that repository is in development, and individual cookbooks are released on the Community site. Further, not all the cookbooks are optimized for, or even work with, with Chef Solo. The latest README.md in the Cookbooks repository should make this pretty clear, too.

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

OTHER TIPS

In my case, this was caused by /home/mjs/workspace/cookbooks containing all of opscode's cookbooks. (i.e. I'd cloned their repo, and was adding a new cookbook.) Even though the runlist specifies my recipe only, chef seems to be doing something to the other cookbooks in the directory, at least one of which assumes that some Windows-related gem is installed.

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top