UP CSI Devcamp

< Resources

Installing pry in Rails 4

by: Neil Calabroso

This guide aims to install pry in your Rails 4 App. This tutorial also fixes the “no such file to load – readline” error when running binding.pry or even rails console.

First, add the following gems to your Gemfile:

group :development, :test do
  gem 'rb-readline'
  gem 'pry'
end

Next, run bundle install.

Example

class UsersController < ApplicationController
  def index
    @users = User.all
    binding.pry
  end
end

Further Notes

See pry’s main repository for more details.