1

When I am running the ChefSpec, getting the below error, though I have the git installed and the required cookbook is getting cloned before reaching this step.

As I understand from the below error that, BerkShelf is unable to find the Git installed in the server. But I can use the git command without any issues and also I have added the git executable path to the PATH variable as mentioned below. But no luck.

Could anyone shed some light, please?

An error occurred in a before(:suite) hook. Failure/Error: raise GitNotInstalled.new Berkshelf::GitNotInstalled: You need to install Git before you can download cookbooks from git repositories. For more information, please see the Git docs: http://git-scm.org. If you have git installed, please make sure it is in your $PATH and accessible by the user running this command.

  • You say "the server". ChefSpec doesn't generally run on a server, it's run from your workstation or in a CI job. – coderanger Sep 07 '18 at 20:30

1 Answers1

1

BerkShelf is unable to find the Git installed in the server. But I can use the git command without any issues and also I have added the git executable path to the PATH variable as mentioned below

That means:

  • either the BerkShelf process is running with a different user than the one for whom you set the PATH.
  • or you set the PATH in a local session (instead of a .bashrc), and the BerkShelf process did not inherit that new PATH value.
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250