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/

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

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 | rbenv install --patch 2.0.0-p451

which I found here:

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:

Thank you, rbenv maintainers and contributors!

Happy Coding! – codegourmet