I\'m setting up my development environment in the new macOS Sierra .
First of all, I installed Rbenv, Ruby (2.3.1)
Almost the same scenario as @Caio Tarifa, Ruby 2.3.3, mysql 5.6 and mysql2. Tried on couple of solutions above and finally make it work with @kylekeesling's approach.
First, tried on solution 1 by @spickermann:
brew reinstall openssl && brew link openssl --force
Nothing happened, same error shown.
Second, tried on solution by @Alessandro Berardi:
bundle config --local build.mysql2 "--with-ldflags=-L/usr/local/opt/openssl/lib --with-cppflags=-I/usr/local/opt/openssl/include"
This got different but more errors since it overwrite gem extension's config so all gem extension installation failed.
Finally, tried on @kylekeesling solution:
xcode-select --install
It fix mysql gem issue as well as nikogiri. Since I already intall Xcode, in my case it's reinstall the Xcode Command Line Tools.