Fetching mysql2 0.3.20
Installing mysql2 0.3.20 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
client.c:367:33: warning: implicit conversion loses integer precision: 'long' to 'unsigned int' [-Wshorten-64-to-32]
elapsed_time = end_time - start_time;
~ ~~~~~~~~~^~~~~~~~~~~~
client.c:439:3: error: use of undeclared identifier 'my_bool'
my_bool res = mysql_read_query_result(client);
^
client.c:441:19: error: use of undeclared identifier 'res'
return (void *)(res == 0 ? Qtrue : Qfalse);
^
client.c:775:3: error: use of undeclared identifier 'my_bool'
my_bool boolval;
^
client.c:806:7: error: use of undeclared identifier 'boolval'
boolval = (value == Qfalse ? 0 : 1);
^
client.c:807:17: error: use of undeclared identifier 'boolval'
retval = &boolval;
^
client.c:810:10: error: use of undeclared identifier 'MYSQL_SECURE_AUTH'; did you mean 'MYSQL_DEFAULT_AUTH'?
case MYSQL_SECURE_AUTH:
^~~~~~~~~~~~~~~~~
MYSQL_DEFAULT_AUTH
/usr/local/Cellar/mysql/8.0.15/include/mysql/mysql.h:188:3: note: 'MYSQL_DEFAULT_AUTH' declared here
MYSQL_DEFAULT_AUTH,
^
client.c:811:7: error: use of undeclared identifier 'boolval'
boolval = (value == Qfalse ? 0 : 1);
^
client.c:812:17: error: use of undeclared identifier 'boolval'
retval = &boolval;
^
client.c:843:38: error: use of undeclared identifier 'boolval'
wrapper->reconnect_enabled = boolval;
^
client.c:1165:56: warning: implicit conversion loses integer precision: 'size_t' (aka 'unsigned long') to 'unsigned int' [-Wshorten-64-to-32]
mysql2rb = mysql2_mysql_enc_name_to_rb(charset_name, charset_name_len);
~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^~~~~~~~~~~~~~~~
client.c:1198: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.15/include/mysql/mysql.h:188:3: note: 'MYSQL_DEFAULT_AUTH' declared here
MYSQL_DEFAULT_AUTH,
^
2 warnings and 10 errors generated.
make: *** [client.o] Error 1
make failed, exit code 2
Gem files will remain installed in /Users/apple/.rvm/gems/ruby-2.3.1/gems/mysql2-0.3.20 for inspection.
Results logged to /Users/apple/.rvm/gems/ruby-2.3.1/extensions/x86_64-darwin-18/2.3.0/mysql2-0.3.20/gem_make.out
An error occurred while installing mysql2 (0.3.20), and Bundler cannot continue.
Make sure that `gem install mysql2 -v '0.3.20' --source 'https://rubygems.org/'` succeeds before bundling.
In Gemfile:
mysql2
brew unlink mysql
brew cleanup
brew install mysql
gem install mysql2
不起作用 前辈们有没有遇到这种情况,求助