Had several times the error from below
undefined method `’ for nil:NilClass
and each time I forgot which was the root cause.
What’s happening is that Chef can’t find some attributes, or some array of attributes that it needs to successfully converge the cookbook.
Run the converge in debug mode: kitchen converge -l=DEBUG and on the first line containing the error, see at what .rb files it points, including the line number, and you’ll discover what attributes you’re missing from the cookbook
Update: Another form of this error that I’ve encountered was
private method `select’ called for nil:NilClass
and this was happening when using artifact_deploy resource from artifact cookbook.
What was really causing the problem was the fact that I was specifying a deploy_to location that was not existing (set to drive D:, when the virtual machine had only a C: drive)