gpt4 book ai didi

ruby - 在没有 rvm 或 rbenv 的情况下编译 Ruby 2.0 错误, `readline.c:1886:26: error: ' Function' undeclared (first use in this function)`

转载 作者:数据小太阳 更新时间:2023-10-29 06:44:53 25 4
gpt4 key购买 nike

我想安装gitlab,不推荐使用任何ruby版本管理器。但是

这是我的操作系统 Linux dqa-dev 3.13.0-24-generic#46-Ubuntu SMP Thu Apr 10 19:08:14 UTC 2014 i686 i686 i686 GNU/Linux

linking shared-object psych.so
installing default psych libraries
make[2]: Leaving directory `/home/poc/ruby-2.0.0-p451/ext/psych'
make[2]: Entering directory `/home/poc/ruby-2.0.0-p451/ext/pty'
compiling pty.c
pty.c: In function 'chfunc':
pty.c:143:12: warning: ignoring return value of 'seteuid', declared with attribute warn_unused_result [-Wunused-result]
seteuid(getuid());
^
linking shared-object pty.so
installing default pty libraries
make[2]: Leaving directory `/home/poc/ruby-2.0.0-p451/ext/pty'
make[2]: Entering directory `/home/poc/ruby-2.0.0-p451/ext/racc/cparse'
compiling cparse.c
linking shared-object racc/cparse.so
installing default cparse libraries
make[2]: Leaving directory `/home/poc/ruby-2.0.0-p451/ext/racc/cparse'
make[2]: Entering directory `/home/poc/ruby-2.0.0-p451/ext/readline'
compiling readline.c
readline.c: In function 'Init_readline':
readline.c:1886:26: error: 'Function' undeclared (first use in this function)
rl_pre_input_hook = (Function *)readline_pre_input_hook;
^
readline.c:1886:26: note: each undeclared identifier is reported only once for each function it appears in
readline.c:1886:36: error: expected expression before ')' token
rl_pre_input_hook = (Function *)readline_pre_input_hook;
^
readline.c: At top level:
readline.c:530:1: warning: 'readline_pre_input_hook' defined but not used [-Wunused-function]
readline_pre_input_hook(void)
^
make[2]: *** [readline.o] Error 1
make[2]: Leaving directory `/home/poc/ruby-2.0.0-p451/ext/readline'
make[1]: *** [ext/readline/all] Error 2
make[1]: Leaving directory `/home/poc/ruby-2.0.0-p451'
make: *** [build-ext] Error 2

最佳答案

我也有 Ubuntu 14.04,我必须让它工作。分享我所做的,以防它对你有用。

我修补了文件 ext/readline/readline.c 替换行 1886:

rl_pre_input_hook = (Function *)readline_pre_input_hook;

rl_pre_input_hook = (rl_hook_func_t *)readline_pre_input_hook;

然后我又试了一次,成功了。

来源:https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=741825

关于ruby - 在没有 rvm 或 rbenv 的情况下编译 Ruby 2.0 错误, `readline.c:1886:26: error: ' Function' undeclared (first use in this function)`,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23488790/

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