Googlefood: chef-spec tries to connect to localhost fauxhai.local
There’s lots of different things that can cause this error. The one that I was hitting was rather unintuitive.
Problem: chefspec started wanting to talk to a local HTTP server and failed
$ rspec spec/*
ERROR: Connection refused connecting to https://localhost/nodes/fauxhai.local, retry 1/5
Root Cause: Recent versions of chefspec need ruby >= 2.2
I was using ruby-2.1.2; that worked find with old versions of chefspec. But somewhere along the line, they made ruby 2.2 a hard dependency.
Unfortunately, they don’t actually tell you “hey, we couldn’t start fauxhai because your ruby is too old” or anything useful like that; they just silently don’t bother running fauxhai, and leave you with the error message about an HTTP timeout.
Solution: Upgrade to ruby 2.2 or higher.
Leave a Reply