Vagrant doesn't detect chef-solo unless re-installed

Posted by nightowl on Server Fault See other posts from Server Fault or by nightowl
Published on 2013-06-14T13:30:01Z Indexed on 2013/11/04 10:00 UTC
Read the original article Hit count: 321

I am using Vagrant to test my Chef recipes in Amazon AWS, and I am encountering an irritating issue:

I initially assumed that Vagrant would install chef itself (as it does when using Virtual Box as the provider) but it seems that this needs to be done using the cloud-init script. However, even after I successfully installed the chef gem via cloud-init I was still getting the following error:

The chef binary (eitherchef-soloorchef-client) was not found

A quick google of this error suggested three probable causes:

  • Chef had failed to install
  • It had installed, but the directory was not in the $PATH environment variable
  • It had installed and in the $PATH but with incorrect permissions

I logged in and double checked; chef-solo and chef-client were installed; The path variable for the user, sudo and root all included /usr/local/bin and permissions were all fine.

I managed to solve this problem by uninstalling and reinstalling the gem using sudo gem install chef. I don't understand why this should resolve the issue and it is a bit of a problem if I have to ssh into a test box and manually install the gem every time.

Does anyone have any suggestions why this might be happening?

© Server Fault or respective owner

Related posts about amazon-web-services

Related posts about vagrant