Skip to content

Instantly share code, notes, and snippets.

@wk8
Last active August 29, 2015 14:00
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wk8/fef2479af6b16a9cac71 to your computer and use it in GitHub Desktop.
Save wk8/fef2479af6b16a9cac71 to your computer and use it in GitHub Desktop.
Minimal patch to get ruby 2.1.1 to compile with readline 6.3.x (?) on Mac OS X. Usage: curl -L https://gist.github.com/wk8/fef2479af6b16a9cac71/raw | ruby-build 2.1.1 --patch or curl -L https://gist.github.com/wk8/fef2479af6b16a9cac71/raw | rbenv install --patch 2.1.1, depending on what you're using.
--- ext/readline/readline.c
+++ ext/readline/readline.c
@@ -1974,7 +1974,7 @@ Init_readline()
rl_attempted_completion_function = readline_attempted_completion_function;
#if defined(HAVE_RL_PRE_INPUT_HOOK)
- rl_pre_input_hook = (Function *)readline_pre_input_hook;
+ rl_pre_input_hook = (rl_hook_func_t *)readline_pre_input_hook;
#endif
#ifdef HAVE_RL_CATCH_SIGNALS
rl_catch_signals = 0;
@christophermaier
Copy link

Using with ruby-install:

ruby-install -p https://gist.github.com/wk8/fef2479af6b16a9cac71/raw ruby 2.1

It'll ask what file to apply the patch to; use ext/readline/readline.c

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment