After the latest upgrade on MacOS when I tried to use docker on my mac to build my new images I got this error:
mkmf.rb can't find header files for ruby at /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/include/ruby.h
After trying multiple and different solutions the only thing that worked for me to get this fixed was removing the previously installed developer tools for command line and install them again by following these steps:
sudo rm -rf /Library/Developer/CommandLineTools xcode-select --install sudo xcodebuild -license accept open /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg
After running those commands and, of course, wait a bit to get everything downloaded and installed, docker commands are now working again.