# Setting IRB Configurations using env variables?

**URL:** <https://www.ruby-forum.com/t/setting-irb-configurations-using-env-variables/190329>\
**Category:** Ruby\
**Created:** [June 17, 2010, 8:03pm UTC](https://www.ruby-forum.com/t/setting-irb-configurations-using-env-variables/190329 "2010-06-17T20:03:53Z")\
**Posts on this page:** 2\
**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:** [June 17, 2010, 8:03pm UTC](https://www.ruby-forum.com/t/setting-irb-configurations-using-env-variables/190329/1 "2010-06-17T20:03:53Z")

</div>

Hi,

Suppose I need to have IRB configurations before I invoke IRB like :

IRB.conf[:IGNORE\_EOF]=true  
IRB.conf[:VERBOSE]=false

This can be set in config files such as ~/.irbrc etc… and saved before  
irb  
is invoked.

But are there _environment variables I can set in shell to set those  
configurations directly_ before I invoke IRB…?  
My idea is to _not_ use a config file to customize my configurations,  
but to  
use some irb env variables to set those before I invoke the irb.

Thanks in advance,

Narayanan

---

<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:** [June 18, 2010, 9:06am UTC](https://www.ruby-forum.com/t/setting-irb-configurations-using-env-variables/190329/2 "2010-06-18T09:06:36Z")

</div>

> Suppose I need to have IRB configurations before I invoke IRB like :
> 
> IRB.conf[:IGNORE\_EOF]=true  
> IRB.conf[:VERBOSE]=false
> 
> This can be set in config files such as ~/.irbrc etc… and saved before  
> irb  
> is invoked.
> 
> But are there _environment variables I can set in shell to set those  
> configurations directly_ before I invoke IRB…?

You can’t set those configurations with ENV variables. To verify  
yourself, here’s the file were irb intializes all of its configurations:  
[http://github.com/ruby/ruby/blob/trunk/lib/irb/init.rb](http://github.com/ruby/ruby/blob/trunk/lib/irb/init.rb). You’ll notice  
some configurations can be manipulated with commandline options to irb.  
Otherwise you have to use .irbrc.

Gabriel
