Содержание
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: 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 1.9.3
Option 2: Build Ruby With GNU Readline Using RVM and Homebrew
You can also install the latest Readline with Homebrew. First install Readline:
$ brew install readline
$ brew link 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 3: 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 1.9.3-p286
Option 4: Using a pure Ruby readline implementation
The easiest way to get a working readline implementation is to install 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
.
Intro
Installation
- System Notifications
- Terminal Colors on Windows
- Add Readline support to Ruby on Mac OS X
- Which Growl library should I use
- Efficient Filesystem Handling
Getting Started
- List of Guard Commands
- Command Line Options for Guard
- List of available Guards
- Guardfile examples
- Run Guard within RubyMine
- Guardfile-DSL / Configuring-Guard
- Configuration Files
- Interacting with Guard
- Guard Signals
Troubleshooting
Advanced use of Guard
Cookbooks
Development
This wiki and the Guard README document contains 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