mysql2: 系统升级后无法在 /usr/local/Cellar/mysql@5.6/5.6.42/bin/mysql_config 找到 mysql_config

mysql2: Cannot find mysql_config at /usr/local/Cellar/mysql@5.6/5.6.42/bin/mysql_config after system upgrade

我将 mac OS Mojave 从 v10.14.0 升级到 v10.14.2 以及我使用 Homebrew 安装的所有软件包。 MySQL 从 v5.6.42 升级到 v5.6.46。升级后mysql2gem开始编译失败:

    current directory: /Users/hirurg103/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/mysql2-0.4.4/ext/mysql2
/Users/hirurg103/.rbenv/versions/2.4.1/bin/ruby -r ./siteconf20191218-70879-1yhhybm.rb extconf.rb
--with-mysql-config=/usr/local/Cellar/mysql@5.6/5.6.42/bin/mysql_config
checking for ruby/thread.h... yes
checking for rb_thread_call_without_gvl() in ruby/thread.h... yes
checking for rb_thread_blocking_region()... no
checking for rb_wait_for_single_fd()... yes
checking for rb_hash_dup()... yes
checking for rb_intern3()... yes
-----
Cannot find mysql_config at /usr/local/Cellar/mysql@5.6/5.6.42/bin/mysql_config
-----

我查看了/usr/local/Cellar/mysql@5.6文件夹的内容,里面没有5.6.42目录:

ls -l /usr/local/Cellar/mysql@5.6/

total 0
drwxr-xr-x  16 hirurg103  staff  512 Dec 18 13:50 5.6.46_2

我正在使用 mysql2 版本 0.4.4

您知道如何解决这个问题吗?谢谢!

我能够通过 运行 gem install mysql2 -v 0.4.4--with-mysql-config 参数解决这个问题:

gem install mysql2 -v 0.4.4 -- --with-mysql-config=/usr/local/Cellar/mysql@5.6/5.6.46_2/bin/mysql_config

在此之后 bundle install 没有错误