Rails安装mysql2 gem报错:Failed to build gem native extension.
Rails安装mysql2 gem:
gem install mysql2
报错:
Error installing mysql2: ERROR: Failed to build gem native extension.
需要安装依赖的包。
Ubuntu/Debian
使用apt-get安装libmysqlclient-dev:
sudo apt-get install libmysqlclient-dev
Red Hat/CentOS
使用yum安装mysql-devl
sudo yum install mysql-devel
Mac
使用Homebrew安装
brew install mysql