Skip to content

Instantly share code, notes, and snippets.

@teohm
Last active August 29, 2015 14:00
Show Gist options
  • Save teohm/11160007 to your computer and use it in GitHub Desktop.
Save teohm/11160007 to your computer and use it in GitHub Desktop.
[Solved] Failed to build ruby 2.x with readline 6.3

[Solved] Failed to build ruby 2.x with readline 6.3

Error

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

Read more

Workaround

While waiting patiently for the patch, for ruby-install users:

# ruby-install 0.4.2 is unable link to the correct readline lib, latest 0.4.3 fixed the issue
brew unlink ruby-install
brew install ruby-install --HEAD

# install ruby 2.1 with patch
ruby-install -p https://gist.githubusercontent.com/plexus/10021256/raw/9d9edf8d4f03643c7dce4d52c576ad40f2a01760/ruby-2.1.1-readline.patch ruby 2.1.1

# install ruby 2.0 with patch
ruby-install -p https://gist.githubusercontent.com/plexus/10021261/raw/305492ebd17308e55eee1baab27568fafaa940cb/ruby-2.0-p451-readline.patch ruby 2.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment