在RHEL 8上安装GEM MySQL2 -V 0.3.21的错误

发布于 2025-02-07 08:07:38 字数 2869 浏览 2 评论 0原文

我正在将应用程序复制到新服务器,因为旧服务器已损坏,但是在尝试运行捆绑式安装时,GEM MySQL2无法安装。

[me@localhost redmine]$ gem install mysql2 -v 0.3.21
Building native extensions. This could take a while...
ERROR:  Error installing mysql2:
        ERROR: Failed to build gem native extension.

    current directory: /home/x-mwojciechow4/.rvm/gems/ruby-2.2.9/gems/mysql2-0.3.21/ext/mysql2
/home/x-mwojciechow4/.rvm/rubies/ruby-2.2.9/bin/ruby -I /home/x-mwojciechow4/.rvm/rubies/ruby-2.2.9/lib/ruby/site_ruby/2.2.0 -r ./siteconf20220613-3672195-xa12ap.rb extconf.rb
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
-----
Using mysql_config at /usr/bin/mysql_config
-----
checking for mysql.h... yes
checking for errmsg.h... yes
checking for mysqld_error.h... yes
-----
Setting libpath to /usr/lib64/mysql
-----
creating Makefile

current directory: /home/x-mwojciechow4/.rvm/gems/ruby-2.2.9/gems/mysql2-0.3.21/ext/mysql2
make "DESTDIR=" clean

current directory: /home/x-mwojciechow4/.rvm/gems/ruby-2.2.9/gems/mysql2-0.3.21/ext/mysql2
make "DESTDIR="
compiling client.c
client.c: In function ‘nogvl_read_query_result’:
client.c:439:3: error: unknown type name ‘my_bool’; did you mean ‘bool’?
   my_bool res = mysql_read_query_result(client);
   ^~~~~~~
   bool
client.c: In function ‘_mysql_client_options’:
client.c:762:3: error: unknown type name ‘my_bool’; did you mean ‘bool’?
   my_bool boolval;
   ^~~~~~~
   bool
client.c:797:10: error: ‘MYSQL_SECURE_AUTH’ undeclared (first use in this function); did you mean ‘MYSQL_DEFAULT_AUTH’?
     case MYSQL_SECURE_AUTH:
          ^~~~~~~~~~~~~~~~~
          MYSQL_DEFAULT_AUTH
client.c:797:10: note: each undeclared identifier is reported only once for each function it appears in
client.c: In function ‘set_secure_auth’:
client.c:1185:38: error: ‘MYSQL_SECURE_AUTH’ undeclared (first use in this function); did you mean ‘MYSQL_DEFAULT_AUTH’?
   return _mysql_client_options(self, MYSQL_SECURE_AUTH, value);
                                      ^~~~~~~~~~~~~~~~~
                                      MYSQL_DEFAULT_AUTH
client.c:1186:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^
make: *** [Makefile:238: client.o] Error 1

make failed, exit code 2

Gem files will remain installed in /home/x-mwojciechow4/.rvm/gems/ruby-2.2.9/gems/mysql2-0.3.21 for inspection.
Results logged to /home/x-mwojciechow4/.rvm/gems/ruby-2.2.9/extensions/x86_64-linux/2.2.0/mysql2-0.3.21/gem_make.out

我注意到的第一个错误是“检查rb_thread_blocking_region()... no“ - 否则我没有通过搜索搜索来找到任何有用的内容。

对我来说,保持相同的MySQL2版本很重要,因为这是一台测试服务器,因此我希望它尽可能接近生产服务器。

系统: RHEL 8.1 Ruby 2.2.9p480 铁轨4.2.7.1 MySQL 8.0.29 MySQL社区服务器-GPL

I am copying my application to a new server, as old one got corrupted, but while trying to run bundle install, gem mysql2 failed to install.

[me@localhost redmine]$ gem install mysql2 -v 0.3.21
Building native extensions. This could take a while...
ERROR:  Error installing mysql2:
        ERROR: Failed to build gem native extension.

    current directory: /home/x-mwojciechow4/.rvm/gems/ruby-2.2.9/gems/mysql2-0.3.21/ext/mysql2
/home/x-mwojciechow4/.rvm/rubies/ruby-2.2.9/bin/ruby -I /home/x-mwojciechow4/.rvm/rubies/ruby-2.2.9/lib/ruby/site_ruby/2.2.0 -r ./siteconf20220613-3672195-xa12ap.rb extconf.rb
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
-----
Using mysql_config at /usr/bin/mysql_config
-----
checking for mysql.h... yes
checking for errmsg.h... yes
checking for mysqld_error.h... yes
-----
Setting libpath to /usr/lib64/mysql
-----
creating Makefile

current directory: /home/x-mwojciechow4/.rvm/gems/ruby-2.2.9/gems/mysql2-0.3.21/ext/mysql2
make "DESTDIR=" clean

current directory: /home/x-mwojciechow4/.rvm/gems/ruby-2.2.9/gems/mysql2-0.3.21/ext/mysql2
make "DESTDIR="
compiling client.c
client.c: In function ‘nogvl_read_query_result’:
client.c:439:3: error: unknown type name ‘my_bool’; did you mean ‘bool’?
   my_bool res = mysql_read_query_result(client);
   ^~~~~~~
   bool
client.c: In function ‘_mysql_client_options’:
client.c:762:3: error: unknown type name ‘my_bool’; did you mean ‘bool’?
   my_bool boolval;
   ^~~~~~~
   bool
client.c:797:10: error: ‘MYSQL_SECURE_AUTH’ undeclared (first use in this function); did you mean ‘MYSQL_DEFAULT_AUTH’?
     case MYSQL_SECURE_AUTH:
          ^~~~~~~~~~~~~~~~~
          MYSQL_DEFAULT_AUTH
client.c:797:10: note: each undeclared identifier is reported only once for each function it appears in
client.c: In function ‘set_secure_auth’:
client.c:1185:38: error: ‘MYSQL_SECURE_AUTH’ undeclared (first use in this function); did you mean ‘MYSQL_DEFAULT_AUTH’?
   return _mysql_client_options(self, MYSQL_SECURE_AUTH, value);
                                      ^~~~~~~~~~~~~~~~~
                                      MYSQL_DEFAULT_AUTH
client.c:1186:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^
make: *** [Makefile:238: client.o] Error 1

make failed, exit code 2

Gem files will remain installed in /home/x-mwojciechow4/.rvm/gems/ruby-2.2.9/gems/mysql2-0.3.21 for inspection.
Results logged to /home/x-mwojciechow4/.rvm/gems/ruby-2.2.9/extensions/x86_64-linux/2.2.0/mysql2-0.3.21/gem_make.out

The first error I notice is "checking for rb_thread_blocking_region()... no" -however I didnt find anything useful by googling this.

It is important to me to stay on the same mysql2 version, as this is a testing server, so I want it to be as close to production server as possible.

system:
RHEL 8.1
Ruby 2.2.9p480
Rails 4.2.7.1
MySql 8.0.29 MySQL Community Server - GPL

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

假装不在乎 2025-02-14 08:07:39

版本0.3.21中的MySQL2 GEM是 >使用MySQL 8.0。

因此,除非有任何实际问题,否则您应该更新宝石版本(无论是在测试和生产时)。 MySQL2 0.4.10(0.4.x的最后一个版本)应与您的导轨版本兼容,并支持MySQL 8.0。如果您还可以将Rails更新为至少4.2.11.3(您应该使用4.2.7.1版以来有很多安全修复程序),也可以使用MySQL2 0.5.x.。

无论如何,您提到的所有Ruby软件版本(即Ruby本身,Rails和MySQL2)都过时了,并且不再收到各自分支机构的任何更新。您应该投资将所有这些更新为新的支持版本。

The mysql2 gem in version 0.3.21 is not compatible with MySQL 8.0.

As such, unless there are any actual concerns, you should update your gem versions (both on testing and production). mysql2 0.4.10 (the last version of 0.4.x) should be compatible with your Rails version and supports MySQL 8.0. If you can also update Rails to at least 4.2.11.3 (which you should, there were a lot of security fixes since version 4.2.7.1), you can also use mysql2 0.5.x.

In any case all of the ruby software versions you mentioned (i.e. ruby itself, rails and mysql2) are outdated and do not receive any updates in their respective branches anymore. You should invest to update all of those to newer supported versions.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文