compile Ruby 2.0 errors without rvm or rbenv , `readline.c:1886:26: error: 'Function' undeclared (first use in this function)`

拟墨画扇 提交于 2019-11-28 07:44:38

I also have Ubuntu 14.04 and I got to make it work. Sharing what I did just in case it works for you.

I patched the file ext/readline/readline.c replacing line 1886:

rl_pre_input_hook = (Function *)readline_pre_input_hook;

With

rl_pre_input_hook = (rl_hook_func_t *)readline_pre_input_hook;

Then I tried to make it again and it worked.

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

I also ran into this issue trying to install ruby-2.0.0-p247 with rbenv. Save some time by using this patch.

You can run it like this:

curl -fsSL https://gist.github.com/ference/d3d4cbbe18309a91ad9b/raw/267ea89fa145c536967831e1af4dea030297b53e/ruby-2.0.0-p247.patch | rbenv install --patch 2.0.0-p247

This is my solution on Ubuntu 14.04 Server edition.

I need to install underline

sudo apt-get install libreadline6 libreadline6-dev

Then, the problem was fixed.

Found a solution from https://github.com/sstephenson/ruby-build/issues/690. What actually missing is libffi-dev. I tried on Ubuntu 12.04 and it is successful.

sudo apt-get install libffi-dev
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!