Environment:
macOS Monterey v12.6
MacBook Pro on Intel i7
Updated from 8.1 to 8.3 mysql, when starting rails server/console, try to run migrations etc - it threw an error
dlopen(/Users/oladik/.rvm/gems/ruby-3.1.4/ruby/3.1.0/gems/mysql2-0.5.6/lib/mysql2/mysql2.bundle, 0x0009): Library not loaded: '/usr/local/opt/mysql/lib/libmysqlclient.22.dylib' (LoadError)
Referenced from: '/Users/oladik/.rvm/gems/ruby-3.1.4/ruby/3.1.0/gems/mysql2-0.5.6/lib/mysql2/mysql2.bundle'
Reason: tried: '/usr/local/opt/mysql/lib/libmysqlclient.22.dylib' (no such file),
'/usr/local/lib/libmysqlclient.22.dylib' (no such file),
'/usr/lib/libmysqlclient.22.dylib' (no such file),
'/usr/local/Cellar/mysql/8.3.0/lib/libmysqlclient.22.dylib' (no such file),
'/usr/local/lib/libmysqlclient.22.dylib' (no such file),
'/usr/lib/libmysqlclient.22.dylib' (no such file) - /Users/oladik/.rvm/gems/ruby-3.1.4/ruby/3.1.0/gems/mysql2-0.5.6/lib/mysql2/mysql2.bundle
I checked this file and currently I have /usr/local/Cellar/mysql/8.3.0/lib/libmysqlclient.23.dylib, but it still trying to access libmysqlclient.22.dylib by some reason
I tried gem pristine mysql2, but it doesn't help
Then fully reinstall brew mysql and gem mysql2 - doesn't help
Also I try to install like gem install mysql2 -- --with-mysql-dir=/usr/local/Cellar/mysql/8.3.0 - no changes
At the same time, the server itself works correctly:
% brew services
Name Status User File
mysql started oladik ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist
% mysql -uroot
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 10
Server version: 8.3.0 Homebrew
Environment: macOS Monterey v12.6 MacBook Pro on Intel i7
Updated from
8.1
to8.3
mysql, when starting rails server/console, try to run migrations etc - it threw an errorI checked this file and currently I have
/usr/local/Cellar/mysql/8.3.0/lib/libmysqlclient.23.dylib
, but it still trying to accesslibmysqlclient.22.dylib
by some reasonI tried
gem pristine mysql2
, but it doesn't help Then fully reinstall brewmysql
and gemmysql2
- doesn't help Also I try to install likegem install mysql2 -- --with-mysql-dir=/usr/local/Cellar/mysql/8.3.0
- no changesAt the same time, the server itself works correctly:
Please let me know if you need more information