我正在尝试编译Ruby,我得到了以下内容:
root@raspberrypi:~/ruby-3.1.2# make -j4
...
linking ruby
make[2]: Leaving directory '/root/ruby-3.1.2'
make[1]: Leaving directory '/root/ruby-3.1.2'
make[1]: Entering directory '/root/ruby-3.1.2'
*** Following extensions are not compiled:
readline:
Could not be configured. It will not be installed.
/root/ruby-3.1.2/ext/readline/extconf.rb:62: Neither readline nor libedit was found
Check ext/readline/mkmf.log for more details.
*** Fix the problems, then remove these directories and try again if you want.
make[1]: Leaving directory '/root/ruby-3.1.2'
root@raspberrypi:~/ruby-3.1.2#
不过,我确实同时安装了:
root@raspberrypi:~/ruby-3.1.2# apt-get install libreadline-dev libedit-dev
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
libedit-dev is already the newest version (3.1-20191231-2).
libreadline-dev is already the newest version (8.1-1).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
这与在Raspbian 10上预期的一样工作,但不确定为什么它不工作在Raspbian 11上?
root@raspberrypi:~/ruby-3.1.2# lsb_release -a
No LSB modules are available.
Distributor ID: Raspbian
Description: Raspbian GNU/Linux 11 (bullseye)
Release: 11
Codename: bullseye
ext/readline/mkmf.log (面向底部)的相关部分还显示如下:
...
have_header: checking for readline/readline.h... -------------------- no
LD_LIBRARY_PATH=.:../.. "gcc -I../../.ext/include/armv7l-linux-eabihf -I../.././include -I../.././ext/readline -D_FILE_OFFSET_BITS=64 -O3 -fno-fast-math -ggdb3 -Wall -Wextra -Wdeprecated-declarations -Wduplicated-cond -Wimplicit-function-declaration -Wimplicit-int -Wmisleading-indentation -Wpointer-arith -Wwrite-strings -Wimplicit-fallthrough=0 -Wmissing-noreturn -Wno-cast-function-type -Wno-constant-logical-operand -Wno-long-long -Wno-missing-field-initializers -Wno-overlength-strings -Wno-packed-bitfield-compat -Wno-parentheses-equality -Wno-self-assign -Wno-tautological-compare -Wno-unused-parameter -Wno-unused-value -Wsuggest-attribute=format -Wsuggest-attribute=noreturn -Wunused-variable -Wundef -c conftest.c"
conftest.c:3:10: fatal error: readline/readline.h: No such file or directory
3 | #include <readline/readline.h>
| ^~~~~~~~~~~~~~~~~~~~~
compilation terminated.
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: #include <readline/readline.h>
/* end */
--------------------
have_header: checking for editline/readline.h... -------------------- no
LD_LIBRARY_PATH=.:../.. "gcc -I../../.ext/include/armv7l-linux-eabihf -I../.././include -I../.././ext/readline -D_FILE_OFFSET_BITS=64 -O3 -fno-fast-math -ggdb3 -Wall -Wextra -Wdeprecated-declarations -Wduplicated-cond -Wimplicit-function-declaration -Wimplicit-int -Wmisleading-indentation -Wpointer-arith -Wwrite-strings -Wimplicit-fallthrough=0 -Wmissing-noreturn -Wno-cast-function-type -Wno-constant-logical-operand -Wno-long-long -Wno-missing-field-initializers -Wno-overlength-strings -Wno-packed-bitfield-compat -Wno-parentheses-equality -Wno-self-assign -Wno-tautological-compare -Wno-unused-parameter -Wno-unused-value -Wsuggest-attribute=format -Wsuggest-attribute=noreturn -Wunused-variable -Wundef -c conftest.c"
conftest.c:3:10: fatal error: editline/readline.h: No such file or directory
3 | #include <editline/readline.h>
| ^~~~~~~~~~~~~~~~~~~~~
compilation terminated.
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: #include <editline/readline.h>
/* end */
--------------------
/root/ruby-3.1.2/ext/readline/extconf.rb:62: Neither readline nor libedit was found
/root/ruby-3.1.2/ext/readline/extconf.rb:62:in `<top (required)>'
./ext/extmk.rb:214:in `load'
./ext/extmk.rb:214:in `block in extmake'
/root/ruby-3.1.2/lib/mkmf.rb:332:in `open'
./ext/extmk.rb:210:in `extmake'
./ext/extmk.rb:572:in `block in <main>'
./ext/extmk.rb:568:in `each'
./ext/extmk.rb:568:in `<main>'
这些文件肯定存在(与Raspbian 10相同的路径):
root@raspberrypi:~/ruby-3.1.2# find / | grep readline.h$
/usr/include/readline/readline.h
/usr/include/editline/readline.h
有什么想法吗?
发布于 2022-05-03 00:10:33
我删除并重新下载了源代码,并按预期进行了编译!-我不知道源代码是如何被破坏的,但这是解决方案!
https://stackoverflow.com/questions/71915846
复制相似问题