Last Updated: February 25, 2016
·
3.907K
· math120908

How to reload module without relaunch rails console.

Purpose

Because launch rails console has highly cost, when I was debugging in a class, keeping relaunching console is annoying.

Code

# remove Class Foo
Object.send(:remove_const, :Foo)
# Reload Class Foo
load 'Foo.rb'