gpt4 book ai didi

ruby - redmine 安装失败,ruby 3.0.4,mysql2 (0.5.4) "undefined method ' split '""rb_enc_interned_str not found"

转载 作者:行者123 更新时间:2023-12-04 19:04:54 61 4
gpt4 key购买 nike

构建新系统:

  ubuntu 20.04
mysql 5.7.38
ruby-install and chruby
ruby 3.0.4
redmine 5.0.0
在用户帐户中,尝试安装 redmine 5.0.0:
bundle install
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

current directory: /home/test_user/.gem/ruby/3.0.4/gems/mysql2-0.5.4/ext/mysql2
/opt/rubies/ruby-3.0.4/bin/ruby -I /opt/rubies/ruby-3.0.4/lib/ruby/3.0.0 -r ./siteconf20220520-28025-uxnsbe.rb
extconf.rb
...
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary libraries and/or headers. Check the mkmf.log file for more details. You may need configuration options.
Provided configuration options:
...
/opt/rubies/ruby-3.0.4/lib/ruby/3.0.0/mkmf.rb:1050:in `block in find_library': undefined method `split' for
nil:NilClass (NoMethodError)
...
检查日志,我看到以下错误:
conftest.c: In function ‘t’:
conftest.c:14:57: error: ‘rb_wait_for_single_fd’ undeclared (first use in this function)
14 | int t(void) { void ((*volatile p)()); p = (void ((*)()))rb_wait_for_single_fd; return !p; }

conftest.c: In function ‘t’:
conftest.c:16:57: error: ‘rb_enc_interned_str’ undeclared (first use in this function); did you mean ‘rb_interned_str’?
16 | int t(void) { void ((*volatile p)()); p = (void ((*)()))rb_enc_interned_str; return !p; }
我安装了以下mysql东西:
$ apt list --installed | grep mysql
libmysqlclient20/unknown,now 5.7.38-1ubuntu18.04 amd64 [installed]
mysql-apt-config/unknown,now 0.8.22-1 all [installed]
mysql-client/unknown,now 5.7.38-1ubuntu18.04 amd64 [installed,upgradable to: 8.0.29-0ubuntu0.20.04.3]
mysql-common/focal,now 5.8+1.0.5ubuntu2 all [installed,automatic]
mysql-community-client/unknown,now 5.7.38-1ubuntu18.04 amd64 [installed,automatic]
mysql-community-server/unknown,now 5.7.38-1ubuntu18.04 amd64 [installed]
mysql-server/unknown,now 5.7.38-1ubuntu18.04 amd64 [installed,upgradable to: 8.0.29-0ubuntu0.20.04.3]
我有一点疑惑; ruby 安装(mkmf.rb,没有方法'split')和 redmine 代码(未声明的函数)报告了错误。
我意识到这是一个新的 ruby​​ 和一个新的 redmine,以及一个旧的 mysql;不确定这是否是问题所在。我想坚持使用 mysql 5.7 以避免升级我现在需要迁移的数据。

最佳答案

您缺少其中一个 MySQL 开发包。对于其他偶然发现这个问题的人来说,候选人是:

default-libmysqld-dev 
default-libmysqlclient-dev
或者有时只是直接包:
libmysqld-dev 
libmysqlclient-dev
在这种特殊情况下,结果是 default-libmysqlclient-dev .

关于ruby - redmine 安装失败,ruby 3.0.4,mysql2 (0.5.4) "undefined method ' split '""rb_enc_interned_str not found",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/72323823/

61 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com