# Problems with request.remote\_ip

**URL:** <https://www.ruby-forum.com/t/problems-with-request-remote-ip/130009>\
**Category:** Rails\
**Created:** [February 24, 2008, 5:30am UTC](https://www.ruby-forum.com/t/problems-with-request-remote-ip/130009 "2008-02-24T05:30:26Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![roybotnik](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/8e7dd6/32.png) [@roybotnik](https://www.ruby-forum.com/u/roybotnik)\
**Post date:** [February 24, 2008, 5:30am UTC](https://www.ruby-forum.com/t/problems-with-request-remote-ip/130009/1 "2008-02-24T05:30:26Z")

</div>

Hello everyone,

I am trying to use request.remote\_ip in my application to log a user’s  
IP address because I have been having a lot of abuse issues. basically  
when a user logs I simply call user.update\_attribute(:last\_ip,  
request.remote\_ip). The problem is that for some reason a lot of people  
that have recently logged in still have NULL listed as their last\_ip in  
the database, even though it properly updates mine when I log in. Why  
would request.remote\_ip be null, and is there a way that I can at least  
get some sort of IP address? I don’t understand how request.remote\_ip  
isn’t working when I see the users’ IP addresses in my production.log.

If anyone has any ideas please help me out. Thanks!!

---

<div class="post-metadata">

**Author:** ![roybotnik](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/8e7dd6/32.png) [@roybotnik](https://www.ruby-forum.com/u/roybotnik)\
**Post date:** [February 24, 2008, 9:41am UTC](https://www.ruby-forum.com/t/problems-with-request-remote-ip/130009/2 "2008-02-24T09:41:02Z")

</div>

it’s request.remote\_addr, not request.remote\_ip

On Sun, Feb 24, 2008 at 3:00 PM, Roy Quader \<  
removed\_email\_address@domain.invalid\> wrote:

> get some sort of IP address? I don’t understand how request.remote\_ip  
> isn’t working when I see the users’ IP addresses in my production.log.
> 
> ## If anyone has any ideas please help me out. Thanks!!
> 
> Posted via [http://www.ruby-forum.com/](http://www.ruby-forum.com/).
> 
> >

–  
Ryan B.

> **[frozenplague.net](http://www.frozenplague.net)**
>
> This domain may be for sale!

Feel free to add me to MSN and/or GTalk as this email.
