ICode9

精准搜索请尝试: 精确搜索
首页 > 数据库> 文章详细

mysql2失败的捆绑安装

2019-09-10 21:15:21  阅读:513  来源: 互联网

标签:mysql2 ruby-on-rails mysql rubygems


我已经把这个问题挂了好几个小时了,我之前发现的关于这个问题的任何内容似乎都没有用.下面是我运行bundle install时的mysql2输出:

Fetching mysql2 0.4.5
Installing mysql2 0.4.5 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

    current directory: /Users/MYUSERNAME/Desktop/MY_PROJECT/vendor/ruby/2.4.0/gems/mysql2-0.4.5/ext/mysql2
/Users/MYUSERNAME/.rbenv/versions/2.4.2/bin/ruby -r ./siteconf20180623-40170-ndn6t0.rb extconf.rb --with-mysql-config=/usr/local/Cellar/mysql/8.0.11/bin/mysql_config
checking for rb_absint_size()... yes
checking for rb_absint_singlebit_p()... yes
checking for ruby/thread.h... yes
checking for rb_thread_call_without_gvl() in ruby/thread.h... yes
checking for rb_thread_blocking_region()... no
checking for rb_wait_for_single_fd()... yes
checking for rb_hash_dup()... yes
checking for rb_intern3()... yes
checking for rb_big_cmp()... yes
-----
Using mysql_config at /usr/local/Cellar/mysql/8.0.11/bin/mysql_config
-----
checking for mysql.h... yes
checking for SSL_MODE_DISABLED in mysql.h... yes
checking for SSL_MODE_PREFERRED in mysql.h... yes
checking for SSL_MODE_REQUIRED in mysql.h... yes
checking for SSL_MODE_VERIFY_CA in mysql.h... yes
checking for SSL_MODE_VERIFY_IDENTITY in mysql.h... yes
checking for errmsg.h... yes
checking for mysqld_error.h... yes
-----
Setting rpath to /usr/local/Cellar/mysql/8.0.11/lib
-----
creating Makefile

current directory: /Users/MYUSERNAME/Desktop/MY_PROJECT/vendor/ruby/2.4.0/gems/mysql2-0.4.5/ext/mysql2
make "DESTDIR=" clean

current directory: /Users/MYUSERNAME/Desktop/MY_PROJECT/vendor/ruby/2.4.0/gems/mysql2-0.4.5/ext/mysql2
make "DESTDIR="
compiling client.c
In file included from client.c:1:
In file included from ./mysql2_ext.h:41:
./result.h:24:3: error: unknown type name 'my_bool'
my_bool *is_null;
^
./result.h:25:3: error: unknown type name 'my_bool'
my_bool *error;
^
client.c:507:3: error: use of undeclared identifier 'my_bool'
my_bool res = mysql_read_query_result(client);
^
client.c:509:19: error: use of undeclared identifier 'res'
return (void *)(res == 0 ? Qtrue : Qfalse);
                ^
client.c:828:3: error: use of undeclared identifier 'my_bool'
my_bool boolval;
^
client.c:859:7: error: use of undeclared identifier 'boolval'
    boolval = (value == Qfalse ? 0 : 1);
    ^
client.c:860:17: error: use of undeclared identifier 'boolval'
    retval = &boolval;
                ^
client.c:863: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.11/include/mysql/mysql.h:188:3: note: 'MYSQL_DEFAULT_AUTH' declared here
MYSQL_DEFAULT_AUTH,
^
client.c:864:7: error: use of undeclared identifier 'boolval'
    boolval = (value == Qfalse ? 0 : 1);
    ^
client.c:865:17: error: use of undeclared identifier 'boolval'
    retval = &boolval;
                ^
client.c:896:38: error: use of undeclared identifier 'boolval'
        wrapper->reconnect_enabled = boolval;
                                    ^
client.c:1285: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.11/include/mysql/mysql.h:188:3: note: 'MYSQL_DEFAULT_AUTH' declared here
MYSQL_DEFAULT_AUTH,
^
12 errors generated.
make: *** [client.o] Error 1

make failed, exit code 2

Gem files will remain installed in /Users/MYUSERNAME/Desktop/MY_PROJECT/vendor/ruby/2.4.0/gems/mysql2-0.4.5 for inspection.
Results logged to /Users/MYUSERNAME/Desktop/MY_PROJECT/vendor/ruby/2.4.0/extensions/x86_64-darwin-17/2.4.0-static/mysql2-0.4.5/gem_make.out

An error occurred while installing mysql2 (0.4.5), and Bundler cannot continue.
Make sure that `gem install mysql2 -v '0.4.5'` succeeds before bundling.

In Gemfile:
mysql2

这是我的Gemfile的相关部分:

gem 'rails', '5.1.4'
gem 'mysql2', '0.4.5'

我正在运行MacOS High Sierra并通过Homebrew安装了MySQL.我尝试运行bundle install –system,将/tmp/mysql.sock添加到我的database.yml(它已经存在),以及重新安装我系统上几乎所有相关的开发工具,都没有运气.

值得注意的是,我在过去做过这个没有问题……我不确定是什么改变了,但它似乎只是我系统上的一个问题.

感谢您的任何帮助,您可以提供

更新:当我运行gem install mysql2 -v’0.4.5’时,我能够正确安装mysql2 v0.4.5的gem – –srcdir = /usr/local/Cellar / mysql / 8.0.11 /包括/

解决方法:

所以问题最终是自制软件最近使mysql v8.x.x成为标准安装而且我运行了自制升级,这使我脱离了我们的代码库支持的标准……注意未来.一旦我将我的系统mysql版本下载以准确反映mysql2正在寻找的内容,它就可以了.

标签:mysql2,ruby-on-rails,mysql,rubygems
来源: https://codeday.me/bug/20190910/1801222.html

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有