Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Reset IRB Console

Tags:

ruby

console

How does one go about saying goodbye to all constants, objects, and the like defined in an irb session to return to a clean slate? By "in", I mean without manipulating subsessions.

like image 433
fny Avatar asked Apr 22 '12 20:04

fny


2 Answers

Type

exec($0)

in your irb console session.

like image 157
sunnyrjuneja Avatar answered Nov 06 '22 05:11

sunnyrjuneja


i am using fedora 16, exec $0 do not work for me. but i found the the way below:

CTRL+L or system("clear") or system("reset")

like image 20
lzj509649444 Avatar answered Nov 06 '22 05:11

lzj509649444