rbenv - 编译Ruby 2.1.1时出错

时间:2014-05-01 23:10:39

标签: ruby compiler-errors rbenv digital-ocean

我在使用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

有什么想法吗?

2 个答案:

答案 0 :(得分:9)

由于readline而无法构建ruby 2.1似乎是known error

我使用suggested patches中的一个成功构建它:

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

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

答案 1 :(得分:0)

以下将解决您的问题:

sudo apt install libssl1.0-dev