How to change directory in irb

>> require 'fileutils'
>> FileUtils.pwd # prints working directory
>> FileUtils.cd '/path/to/requiredfolder' # takes you to required directory

To exit irb either exit or CTRL+D should work.