4

我在 DigitalOcean Droplet 上编译 Ruby 时遇到问题。

rbenv 0.4.0-97-gfe0b243

Ubuntu 14.04 LTS

Linux bashman 3.13.0-24-generic #46-Ubuntu SMP Thu Apr 10 19:11:08 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux

rbenv install 2.1.1

给我:https ://gist.github.com/astropanic/e4d3a3602612b3c21636

失败似乎与以下方面有关:

compiling readline.c
readline.c: In function ‘Init_readline’:
readline.c:1977:26: error: ‘Function’ undeclared (first use in this function)
rl_pre_input_hook = (Function *)readline_pre_input_hook;
^
readline.c:1977:26: note: each undeclared identifier is reported only once for each function it appears in
readline.c:1977:36: error: expected expression before ‘)’ token
rl_pre_input_hook = (Function *)readline_pre_input_hook;
^
readline.c: At top level:
readline.c:634: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 `/tmp/ruby-build.20140502004823.5335/ruby-2.1.1/ext/readline'
make[1]: *** [ext/readline/all] Error 2
make[1]: Leaving directory `/tmp/ruby-build.20140502004823.5335/ruby-2.1.1'
make: *** [

build-ext] Error 2

有任何想法吗 ?

4

2 回答 2

9

由于 readline 而无法构建 ruby​​ 2.1 似乎是一个已知错误

我使用以下建议的补丁之一成功构建了它:

curl -fsSL https://gist.github.com/mislav/a18b9d7f0dc5b9efc162.txt | rbenv install --patch 2.1.1

将 readline 库降级到 6.2.4 版本是一个替代建议,但我没有尝试过。

于 2014-05-01T23:22:24.747 回答
1

以下将解决您的问题:

sudo apt install libssl1.0-dev
于 2019-01-11T05:50:39.860 回答