Can't install mysql2 gem on macOS Sierra

2019-01-31 11:14发布

问题:

I'm setting up my development environment in the new macOS Sierra .

First of all, I installed Rbenv, Ruby (2.3.1), Homebrew and so the latest version of MySQL (5.7.15).

$ brew install mysql
$ mysql.server start

Ok, MySQL was initialized. Time to install the mysql2 gem...

$ gem install mysql2 -- --with-mysql-config=/usr/local/Cellar/mysql/5.7.15/bin/mysql_config

But it didn't work.