Any errors with $'\r': command not found
This is due to the autocrlf setting on your git.config it is automatically converting newline chars to Windows style newlines. For chef scripts, this is bad. Change your git config to:
[core]
autocrlf = input
This will keep unix style newline chars and change them to unix style on check in (or whatever your original file is). Also, change your IDE and editors you use to edit scripts to use unix style chars.