Unable to start rails server after install mysql@5.7

Viewed 16

I recently uninstalled the mysql@5.6 and installed mysql@5.7. But now when I start the rails server, I get the following error.

Library not loaded: /usr/local/opt/mysql@5.6/lib/libmysqlclient.18.dylib (LoadError)

It is still searching for mysql@5.6 that is why it is failing. I have started the mysql server and even added the below line in my .zshrc file

export PATH="/usr/local/opt/mysql@5.7/bin:$PATH"

Please let me know if someone knows how to fix this.

I have the following file present:

/usr/local/opt/mysql@5.7/lib/libmysqlclient.20.dylib
1 Answers

Just uninstall the mysql2 gem that was build against your old MySQL version with

gem uninstall mysql2

And reinstall it with

Bundle install
Related