简体   繁体   English

安装 mysql@5.7 后无法启动 rails 服务器

[英]Unable to start rails server after install mysql@5.7

I recently uninstalled the mysql@5.6 and installed mysql@5.7.我最近卸载了 mysql@5.6 并安装了 mysql@5.7。 But now when I start the rails server, I get the following error.但是现在当我启动 rails 服务器时,出现以下错误。

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.它仍在搜索 mysql@5.6 这就是它失败的原因。 I have started the mysql server and even added the below line in my .zshrc file我已经启动了.zshrc服务器,甚至在我的 .zshrc 文件中添加了以下行

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

Just uninstall the mysql2 gem that was build against your old MySQL version with只需卸载针对旧 MySQL 版本构建的 mysql2 gem

gem uninstall mysql2

And reinstall it with并重新安装它

Bundle install

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM