# .irbrc location/path

**URL:** <https://www.ruby-forum.com/t/irbrc-location-path/191068>\
**Category:** Ruby\
**Created:** [July 4, 2010, 5:40am UTC](https://www.ruby-forum.com/t/irbrc-location-path/191068 "2010-07-04T05:40:41Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Narayanan\_K](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/a3d4f5/32.png) [@Narayanan\_K](https://www.ruby-forum.com/u/Narayanan_K)\
**Post date:** [July 4, 2010, 5:40am UTC](https://www.ruby-forum.com/t/irbrc-location-path/191068/1 "2010-07-04T05:40:41Z")

</div>

Hi all,

I want to place _.irbrc_ config file in a folder in _/tmp_ or any other  
folder other than under /home and point my _$IRBRC_ environment variable  
to  
this location.  
_Is this possible??_

From the init.rb file, I found the following code snippet:

# enumerate possible rc-file base name generators

def IRB.rc\_file\_generators  
if irbrc = ENV[“IRBRC”]  
yield proc{|rc| rc == “rc” ? irbrc : irbrc+rc}  
end  
if home = ENV[“HOME”]  
yield proc{|rc| home+"/.irb#{rc}"}  
end  
home = Dir.pwd  
yield proc{|rc| home+"/.irb#{rc}"}  
yield proc{|rc| home+"/irb#{rc.sub(/\A\_?/, ‘.’)}"}  
yield proc{|rc| home+"/\_irb#{rc}"}  
_yield proc{|rc| home+"/$irb#{rc}"}_  
end

Could somebody please help me understand the above method? Can .irbrc be  
stored in folders other than home, like in /tmp or in /root etc…?

Thanks in advance,

Regards,  
Narayanan
