我的rails应用程序无法启动,因为mysql2加载错误。我尝试了许多解决方案,但没有一个解决不了这个问题。甚至连rake命令都不能执行。
rake aborted!
LoadError: cannot load such file -- mysql2/mysql2我的gemfile是:
ruby '2.5.1'
gem 'rails', '~> 4.2.4'
gem 'mysql2', '~> 0.5.2'已成功安装捆绑包。Mysql安装正确。然而,这个错误发生在MacOS上。
发布于 2021-11-24 15:24:28
只需使用以下命令卸载并重新安装:
gem install mysql2如果这不起作用,您可以尝试将以下内容添加到mysql_config中
gem install mysql2 -v 0.4.4 -- --with-mysql-config=/usr/local/Cellar/mysql@5.6/5.6.42/bin/mysql_config --with-ldflags=-L/usr/local/opt/openssl/lib --with-cppflags=-I/usr/local/opt/openssl/includehttps://stackoverflow.com/questions/70076037
复制相似问题