pry gem how to reload?

Nik So picture Nik So · Sep 8, 2011 · Viewed 17.9k times · Source

I am using the Pry gem in my Rails console, but the pry flavored rails-console seems to have lost the reload! method for reloading models and stuff.

Here's how I start the pry console

c:\rails\app> pry -r ./config/environment

Thank You

Answer

Rodrigo Dias picture Rodrigo Dias · Dec 10, 2012

To use reload! like the rails console command, add this code to your .pryrc

# load Rails Console helpers like reload
require 'rails/console/app'
extend Rails::ConsoleMethods
puts 'Rails Console Helpers loaded'

EDIT== Gem pry-rails already do all of this, much simplier .