codegourmet

savory code and other culinary highlights

Ruby 2.0 Not Compiling Due to Readline Error

| Comments

Ruby 2.0.0 didn’t compile anymore after reinstalling rbenv on my Ubuntu 14.04 system. The error message was only hinting at /tmp/ruby-build.xyz.log.

Inside the build log I found an error similar to this:

1
2
readline.c:1977:26: error: ‘Function’ undeclared (first use in this function)
     rl_pre_input_hook = (Function *)readline_pre_input_hook;

The reason for this is that readline-6.3 isn’t supported by this ruby version.

I was able to install with the following patch:

curl -fsSL https://gist.github.com/LeonB/10503374/raw | rbenv install --patch 2.0.0-p451

which I found here: https://github.com/sstephenson/ruby-build/issues/526

Although my ruby isn’t the exact patchlevel mentioned in the rbenv issue, it worked like a charm.

If you are installing ruby 2.1.1, you might give mislav’s patch a try:
https://gist.github.com/mislav/a18b9d7f0dc5b9efc162.txt

Thank you, rbenv maintainers and contributors!

Happy Coding! – codegourmet

Comments