-
Notifications
You must be signed in to change notification settings - Fork 487
Add Readline support to Ruby on Mac OS X
-
NOTE: guard-zeus causes issues when typing into the Pry session.
- See: https://github.com/guard/guard-zeus/issues/18 for a workaround
- Adding Readline support to Pry
If you are on Mac OS X and have problems with either Guard not reacting to file changes or Pry behaving strangely, then you probably suffer under a Ruby build that uses `libedit` instead of `readline`.
If you are not using Mac OS X or are using JRuby, then you’re fine.
- Option 1: Using a pure Ruby readline implementation
The easiest way to get a working readline implementation is to install [rb-readline](https://github.com/luislavena/rb-readline), a pure Ruby readline implementation. You can install it by simply adding
group :development do
gem 'rb-readline'
end
to your `Gemfile` and install it with `bundle exec`.
- Option 2: Build Ruby With GNU Readline Using RVM
You can use RVM to build your Ruby with GNU readline support. First, install the readline package with RVM:
$ rvm pkg install readline --verify-downloads 1
Then configure RVM to use the readline package by adding
ruby_configure_flags=--with-readline-dir="$rvm_path/usr"
to `~/.rvm/user/db`. Finally, you need to reinstall your Ruby of choice:
$ rvm reinstall 2.3.1
- Option 3: Build Ruby With GNU Readline Using RVM and Homebrew
You can also install the latest Readline with [Homebrew](http://mxcl.github.com/homebrew/). First install Readline:
$ brew install readline
$ brew link --force readline
Then configure RVM to use the Homebrew readline by adding
ruby_configure_flags=--with-readline-dir=/usr/local/opt/readline
to `~/.rvm/user/db`. Finally, you need to reinstall your Ruby of choice:
$ rvm reinstall 1.9.3
- Option 4: Build Ruby With GNU Readline Using rbenv, ruby_build and Homebrew
As a rbenv user, you can install readline and ruby_build with Homebrew:
$ brew install readline ruby-build
now set the configure options when compile Ruby:
$ RUBY_CONFIGURE_OPTS=--with-readline-dir=`brew --prefix readline` rbenv install 2.3.1
This wiki and the Guard README document contain a lot of information, please take your time and read these instructions carefully.
If you run into any trouble, you may start by understanding how Guard works.
We provide detailed changes for each Guard release.
Be sure to read the CONTRIBUTING guidelines before reporting a new Guard issue or open a pull request.
If you have any questions about the Guard usage or want to share some information with the Guard community, please go to one of the following places:
- Google+ community
- Google group
- StackOverflow
- IRC channel
#guard
(irc.freenode.net) for chatting