Skip to content

Instantly share code, notes, and snippets.

@jwilkins
Created September 30, 2011 09:18
Show Gist options
  • Save jwilkins/1253205 to your computer and use it in GitHub Desktop.
Save jwilkins/1253205 to your computer and use it in GitHub Desktop.
True Readline for Ruby 1.8.7-p174 on OS X 10.6 using Homebrew
# http://andre.arko.net/2011/05/26/add-true-readline-to-ruby-on-os-x-1067/
# Install readline
brew install readline
# Download the readline extension
cd /tmp
svn co http://svn.ruby-lang.org/repos/ruby/tags/v1_8_7_174/ext/readline/
# Compile the bundle against homebrewed readline
make readline.o CFLAGS=‘-I/usr/local/Cellar/readline/6.1/include -DHAVE_RL_USERNAME_COMPLETION_FUNCTION’
cc -arch i386 -arch x86_64 -pipe -bundle -undefined dynamic_lookup -o readline.bundle readline.o -L/usr/local/Cellar/readline/6.1/lib -L/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib -L. -arch i386 -arch x86_64 -lruby -lreadline -lncurses -lpthread -ldl
# Move the bundle into the right place
cd /Library/Ruby/Site/1.8/universal-darwin10.0/
sudo mv readline.bundle readline.bundle.libedit
sudo mv /tmp/readline/readline.bundle ./readline.bundle
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment