# Getting IP address through Ruby On Rails

**URL:** <https://www.ruby-forum.com/t/getting-ip-address-through-ruby-on-rails/154639>\
**Category:** Rails\
**Created:** [December 2, 2008, 2:56pm UTC](https://www.ruby-forum.com/t/getting-ip-address-through-ruby-on-rails/154639 "2008-12-02T14:56:01Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![hema\_mca](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/779978/32.png) [@hema\_mca](https://www.ruby-forum.com/u/hema_mca)\
**Post date:** [December 2, 2008, 2:56pm UTC](https://www.ruby-forum.com/t/getting-ip-address-through-ruby-on-rails/154639/1 "2008-12-02T14:56:01Z")

</div>

Hi,  
Can Anyone tell me how to get the IP address of the system through  
rails  
application?  
The system’s IP on which the application running

Thanks,

---

<div class="post-metadata">

**Author:** ![hema\_mca](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/779978/32.png) [@hema\_mca](https://www.ruby-forum.com/u/hema_mca)\
**Post date:** [December 2, 2008, 3:19pm UTC](https://www.ruby-forum.com/t/getting-ip-address-through-ruby-on-rails/154639/2 "2008-12-02T15:19:34Z")

</div>

On 2 Dec 2008, at 13:55, hema gonaboina wrote:

> Hi,  
> Can Anyone tell me how to get the IP address of the system  
> through rails application?  
> The system’s IP on which the application running

Well request.host tells you the host (which isn’t quite the same  
thing). Obviously you can grep the output of ifconfig -a but that  
might not be entirely helpful (eg on the servers that we rung that  
would return several ip addresses).

Fred

---

<div class="post-metadata">

**Author:** ![hema\_mca](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/779978/32.png) [@hema\_mca](https://www.ruby-forum.com/u/hema_mca)\
**Post date:** [December 3, 2008, 6:39am UTC](https://www.ruby-forum.com/t/getting-ip-address-through-ruby-on-rails/154639/3 "2008-12-03T06:39:56Z")

</div>

Thank You Fred it worked …

On Dec 2, 7:18 pm, Frederick C. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)
