macosserverspec

Serverspec fails to verify any package installed by pip on OS X target


Using serverspec-2.36.0 I cannot verify any package installed by pip on OS X El Capitan virtual machine.

Testing the command executed by Serverspec gives correct results.

The following example is for ansible installed with pip install ansible --user on user vagrant.

I am clueless regarding both: the reason and next possible steps in troubleshooting.


troubleshooting


Solution

  • For reasons beyond my understanding Serverspec could not find either OS X's native Python (in /usr/bin/python) or the one installed with Homebrew (in /usr/local/bin/python).

    As a workaround I added:

    set :path, '/usr/local/bin:$PATH'
    

    to spec_helper.rb.