0

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?

2 Answers 2

2

I wouldn't install chef-client via the gem.

Opscode recommends installing via their "omnibus" installer.

A handy way to do this, via a Vagrant plugin is https://github.com/schisamo/vagrant-omnibus. vagrant-omnibus supports several provisioners, including vagrant-aws, and also supports a bunch of different distributions.

It's generally as easy as:

$ vagrant plugin install vagrant-omnibus and adding a line of configuration to your Vagrantfile,

-1

Got the same problem here... for the time being I fixed it running:

vagrant ssh -c 'sudo ln -s /opt/chef/bin/* /usr/local/bin/'

But that is a crappy solution... I hope find something better as soon as I got some time.

1
  • BTW, please, somebody vote negative my own answer! is crappy :)
    – Keymon
    Sep 20, 2013 at 16:39

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .