MySQL2 with native extensions ERROR: Failed to build gem native extension. (Gem::Installer::ExtensionBuildError)
Try with this, it worked for me:
sudo apt-get install libmysql-ruby libmysqlclient-dev
If you're using rvm
, don't install libmysql-ruby
because it's related with Ruby included in Ubuntu packages. It should be good enough with:
sudo apt-get install libmysqlclient-dev
In my case only unlinking symlinks and reinstalling mysql in brew helped:
brew unlink mysql
brew cleanup
brew install mysql
gem install mysql2