Search code examples
mysqlmacos-mojavemysql2mysql-5.6

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


I upgraded mac OS Mojave from v10.14.0 to v10.14.2 and all the packages I installed with Homebrew. MySQL got upgraded from v5.6.42 to v5.6.46. After the upgrade mysql2 gem started to fail to compile with:

    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
-----

I looked at the contents of the /usr/local/Cellar/mysql@5.6 folder and there is no 5.6.42 directory in it:

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

I am using mysql2 version 0.4.4

Do you have any ideas how to fix this issue? Thank you!


Solution

  • I was able to solve this issue by running gem install mysql2 -v 0.4.4 with --with-mysql-config argument:

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

    After this bundle install went without errors