# Reading from a .ini file

**URL:** <https://www.ruby-forum.com/t/reading-from-a-ini-file/144081>\
**Category:** Ruby\
**Created:** [July 25, 2008, 7:38am UTC](https://www.ruby-forum.com/t/reading-from-a-ini-file/144081 "2008-07-25T07:38:42Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![kishorerp](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/3da27b/32.png) [@kishorerp](https://www.ruby-forum.com/u/kishorerp)\
**Post date:** [July 25, 2008, 7:38am UTC](https://www.ruby-forum.com/t/reading-from-a-ini-file/144081/1 "2008-07-25T07:38:42Z")

</div>

Hi all,  
I have a .ini file that looks like below.(in the same directory where  
ruby is installed)  
[info]  
URL=https://172.16.212.73/core  
UID=admin  
passwd=passwd

In a .rb file, how do i read data from a .ini file.I have installed the  
ini-0.1.1.  
Pls help  
Thank you  
Kishore

---

<div class="post-metadata">

**Author:** ![kishorerp](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/3da27b/32.png) [@kishorerp](https://www.ruby-forum.com/u/kishorerp)\
**Post date:** [July 25, 2008, 8:00am UTC](https://www.ruby-forum.com/t/reading-from-a-ini-file/144081/2 "2008-07-25T08:00:08Z")

</div>

Kishore Rp wrote:

> Hi all,  
> I have a .ini file that looks like below.(in the same directory where  
> ruby is installed)  
> [info]  
> URL=https://172.16.212.73/core  
> UID=admin  
> passwd=passwd
> 
> In a .rb file, how do i read data from a .ini file.I have installed the  
> ini-0.1.1.  
> Pls help  
> Thank you  
> Kishore

Have you tried googling  
ruby ini  
?  
GL!  
-R

---

<div class="post-metadata">

**Author:** ![kishorerp](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/3da27b/32.png) [@kishorerp](https://www.ruby-forum.com/u/kishorerp)\
**Post date:** [July 25, 2008, 8:16am UTC](https://www.ruby-forum.com/t/reading-from-a-ini-file/144081/3 "2008-07-25T08:16:31Z")

</div>

Thanks Roger.  
i tried googling combinations  
lemme try ruby ini.

> Have you tried googling  
> ruby ini  
> ?  
> GL!  
> -R

---

<div class="post-metadata">

**Author:** ![kishorerp](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/3da27b/32.png) [@kishorerp](https://www.ruby-forum.com/u/kishorerp)\
**Post date:** [July 25, 2008, 9:13am UTC](https://www.ruby-forum.com/t/reading-from-a-ini-file/144081/4 "2008-07-25T09:13:26Z")

</div>

got the solution.  
Used the parseconfig gem  
Kishore Rp wrote:

> Thanks Roger.  
> i tried googling combinations  
> lemme try ruby ini.
> 
> > Have you tried googling  
> > ruby ini  
> > ?  
> > GL!  
> > -R

---

<div class="post-metadata">

**Author:** ![kishorerp](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/3da27b/32.png) [@kishorerp](https://www.ruby-forum.com/u/kishorerp)\
**Post date:** [July 25, 2008, 9:21am UTC](https://www.ruby-forum.com/t/reading-from-a-ini-file/144081/5 "2008-07-25T09:21:52Z")

</div>

On Jul 25, 9:07 am, Kishore Rp [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> > > ?  
> > > GL!  
> > > -R
> 
> –  
> Posted viahttp://www.ruby-forum.com/.

look at [http://snippets.dzone.com/posts/show/4918](http://snippets.dzone.com/posts/show/4918)

---

<div class="post-metadata">

**Author:** ![kishorerp](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/3da27b/32.png) [@kishorerp](https://www.ruby-forum.com/u/kishorerp)\
**Post date:** [July 25, 2008, 10:35am UTC](https://www.ruby-forum.com/t/reading-from-a-ini-file/144081/6 "2008-07-25T10:35:46Z")

</div>

WoW…  
Thanks a lot…Roger…

Dejan D. wrote:

> On Jul 25, 9:07ï¿½am, Kishore Rp [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:
> 
> > > > ?  
> > > > GL!  
> > > > -R
> > 
> > –  
> > Posted viahttp://www.ruby-forum.com/.
> 
> look at [http://snippets.dzone.com/posts/show/4918](http://snippets.dzone.com/posts/show/4918)

---

<div class="post-metadata">

**Author:** ![kishorerp](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/3da27b/32.png) [@kishorerp](https://www.ruby-forum.com/u/kishorerp)\
**Post date:** [July 25, 2008, 10:36am UTC](https://www.ruby-forum.com/t/reading-from-a-ini-file/144081/7 "2008-07-25T10:36:41Z")

</div>

Typo error sorry …Thanks a lot Dejan D.

Kishore Rp wrote:

> WoW…  
> Thanks a lot…Roger…
> 
> Dejan D. wrote:
> 
> > On Jul 25, 9:07ï¿½am, Kishore Rp [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:
> > 
> > > > > ?  
> > > > > GL!  
> > > > > -R
> > > 
> > > –  
> > > Posted viahttp://www.ruby-forum.com/.
> > 
> > look at [http://snippets.dzone.com/posts/show/4918](http://snippets.dzone.com/posts/show/4918)
