【发布时间】:2021-06-28 06:17:01
【问题描述】:
我最近将mysql从mysql5.7更新为mysql8.0.4。我将 mysql2 gem 从 0.4.9 更新为 0.5.3
之后我开始收到以下错误:
/Users/user/.rvm/gems/ruby-2.4.0@talent_now/gems/activerecord-5.1.4/lib/active_record/connection_adapters/connection_specification.rb:188:in `rescue in spec':
Specified 'mysql2' for database adapter, but the gem is not loaded. Add `gem 'mysql2'` to your Gemfile (and ensure its version is at the minimum required by ActiveRecord). (Gem::LoadError)
我试图将 mysql2 降级为0.4.9,但后来我得到了
/usr/local/Cellar/mysql/8.0.25_1/include/mysql/mysql.h:187:3: note: 'MYSQL_DEFAULT_AUTH' declared here
MYSQL_DEFAULT_AUTH,
^
client.c:1315:38: error: use of undeclared identifier 'MYSQL_SECURE_AUTH'; did you mean 'MYSQL_DEFAULT_AUTH'?
return _mysql_client_options(self, MYSQL_SECURE_AUTH, value);
^~~~~~~~~~~~~~~~~
MYSQL_DEFAULT_AUTH
/usr/local/Cellar/mysql/8.0.25_1/include/mysql/mysql.h:187:3: note: 'MYSQL_DEFAULT_AUTH' declared here
MYSQL_DEFAULT_AUTH,
^
2 errors generated.
make: *** [client.o] Error 1
make failed, exit code 2
我在 mac catalina 中使用Rails5.1.4
【问题讨论】:
标签: macos mysql2 ruby-on-rails-5.1