Hi all, I want to capture IP address in ruby 1.8.7 can any one help me out how to capture IP. Thanks in advance -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/7a0ea49a-cede-4bd1-b797-26f0b8c630c9%40googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
I have tried with request.remote_ip.But this works in rails not in ruby. I have to pass ip address as a parameter. On Tue, Jun 18, 2013 at 11:26 AM, Khan <emailtosameenakhan-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hi all, I want to capture IP address in ruby 1.8.7 can any one help me out > how to capture IP. > > > > Thanks in advance > > -- > You received this message because you are subscribed to the Google Groups > "Ruby on Rails: Talk" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To view this discussion on the web visit > https://groups.google.com/d/msgid/rubyonrails-talk/7a0ea49a-cede-4bd1-b797-26f0b8c630c9%40googlegroups.com > . > For more options, visit https://groups.google.com/groups/opt_out. > > >-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CABvThQcTUOaLYWy7KnXweG8QpSi0Q%3D47VBy8c5YojfEg%3D2HPyQ%40mail.gmail.com. For more options, visit https://groups.google.com/groups/opt_out.
How about using *request.remote_addr ?* Regards, Seeni Rafiyullah Khan A, <srkhan-E9Vo0z8jLxLQT0dZR+AlfA@public.gmane.org>** On Tue, Jun 18, 2013 at 1:56 AM, Khan <emailtosameenakhan-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hi all, I want to capture IP address in ruby 1.8.7 can any one help me out > how to capture IP. > > > > Thanks in advance > > -- > You received this message because you are subscribed to the Google Groups > "Ruby on Rails: Talk" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To view this discussion on the web visit > https://groups.google.com/d/msgid/rubyonrails-talk/7a0ea49a-cede-4bd1-b797-26f0b8c630c9%40googlegroups.com > . > For more options, visit https://groups.google.com/groups/opt_out. > > >-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CA%2BfXU%2B3ngJR57FXUoHyVWPWPLfiM6zzMv%2BqRSo94Fxs1TU-Z2g%40mail.gmail.com. For more options, visit https://groups.google.com/groups/opt_out.
Thanks Rafi for your reply but can I use request.remore_addr directly like ip = request.remote_addr in ruby. it is saying undefined request local vairable. On Tue, Jun 18, 2013 at 12:09 PM, Rafi A <rafiglitz-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> How about using *request.remote_addr ?* > > > Regards, > Seeni Rafiyullah Khan A, > <srkhan-E9Vo0z8jLxLQT0dZR+AlfA@public.gmane.org>** > > > On Tue, Jun 18, 2013 at 1:56 AM, Khan <emailtosameenakhan-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>wrote: > >> Hi all, I want to capture IP address in ruby 1.8.7 can any one help me >> out how to capture IP. >> >> >> >> Thanks in advance >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Ruby on Rails: Talk" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >> To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/rubyonrails-talk/7a0ea49a-cede-4bd1-b797-26f0b8c630c9%40googlegroups.com >> . >> For more options, visit https://groups.google.com/groups/opt_out. >> >> >> > > -- > You received this message because you are subscribed to the Google Groups > "Ruby on Rails: Talk" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To view this discussion on the web visit > https://groups.google.com/d/msgid/rubyonrails-talk/CA%2BfXU%2B3ngJR57FXUoHyVWPWPLfiM6zzMv%2BqRSo94Fxs1TU-Z2g%40mail.gmail.com > . > > For more options, visit https://groups.google.com/groups/opt_out. > > >-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CABvThQfbk2%2Be1Pi3tQgPDfgMPaWaFAEPd%2BYgs7hgRWp3MYPJPg%40mail.gmail.com. For more options, visit https://groups.google.com/groups/opt_out.
Can you copy your ruby script ? Regards, Logan Sent from mobile device On 18 Jun 2013 12:35, "sameena Khan" <emailtosameenakhan-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Thanks Rafi for your reply but can I use request.remore_addr directly like > ip = request.remote_addr in ruby. it is saying undefined request local > vairable. > > > On Tue, Jun 18, 2013 at 12:09 PM, Rafi A <rafiglitz-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > >> How about using *request.remote_addr ?* >> >> >> Regards, >> Seeni Rafiyullah Khan A, >> <srkhan-E9Vo0z8jLxLQT0dZR+AlfA@public.gmane.org>** >> >> >> On Tue, Jun 18, 2013 at 1:56 AM, Khan <emailtosameenakhan-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>wrote: >> >>> Hi all, I want to capture IP address in ruby 1.8.7 can any one help me >>> out how to capture IP. >>> >>> >>> >>> Thanks in advance >>> >>> -- >>> You received this message because you are subscribed to the Google >>> Groups "Ruby on Rails: Talk" group. >>> To unsubscribe from this group and stop receiving emails from it, send >>> an email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >>> To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >>> To view this discussion on the web visit >>> https://groups.google.com/d/msgid/rubyonrails-talk/7a0ea49a-cede-4bd1-b797-26f0b8c630c9%40googlegroups.com >>> . >>> For more options, visit https://groups.google.com/groups/opt_out. >>> >>> >>> >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Ruby on Rails: Talk" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >> To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/rubyonrails-talk/CA%2BfXU%2B3ngJR57FXUoHyVWPWPLfiM6zzMv%2BqRSo94Fxs1TU-Z2g%40mail.gmail.com >> . >> >> For more options, visit https://groups.google.com/groups/opt_out. >> >> >> > > -- > You received this message because you are subscribed to the Google Groups > "Ruby on Rails: Talk" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To view this discussion on the web visit > https://groups.google.com/d/msgid/rubyonrails-talk/CABvThQfbk2%2Be1Pi3tQgPDfgMPaWaFAEPd%2BYgs7hgRWp3MYPJPg%40mail.gmail.com > . > For more options, visit https://groups.google.com/groups/opt_out. > > >-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAD_i5MEuNpDEy4AgwwZjzk19ooBvjcaAO8_wF8VL4vsFrSh8JQ%40mail.gmail.com. For more options, visit https://groups.google.com/groups/opt_out.
The controller is intended to handle things related to the request and response. Are you trying this out when you are inside the model?? If so, then you can''t access the request inside model. Regards, Seeni Rafiyullah Khan A On Tue, Jun 18, 2013 at 3:05 AM, sameena Khan <emailtosameenakhan-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>wrote:> Thanks Rafi for your reply but can I use request.remore_addr directly like > ip = request.remote_addr in ruby. it is saying undefined request local > vairable. > > > On Tue, Jun 18, 2013 at 12:09 PM, Rafi A <rafiglitz-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > >> How about using *request.remote_addr ?* >> >> >> Regards, >> Seeni Rafiyullah Khan A, >> <srkhan-E9Vo0z8jLxLQT0dZR+AlfA@public.gmane.org>** >> >> >> On Tue, Jun 18, 2013 at 1:56 AM, Khan <emailtosameenakhan-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>wrote: >> >>> Hi all, I want to capture IP address in ruby 1.8.7 can any one help me >>> out how to capture IP. >>> >>> >>> >>> Thanks in advance >>> >>> -- >>> You received this message because you are subscribed to the Google >>> Groups "Ruby on Rails: Talk" group. >>> To unsubscribe from this group and stop receiving emails from it, send >>> an email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >>> To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >>> To view this discussion on the web visit >>> https://groups.google.com/d/msgid/rubyonrails-talk/7a0ea49a-cede-4bd1-b797-26f0b8c630c9%40googlegroups.com >>> . >>> For more options, visit https://groups.google.com/groups/opt_out. >>> >>> >>> >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Ruby on Rails: Talk" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >> To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/rubyonrails-talk/CA%2BfXU%2B3ngJR57FXUoHyVWPWPLfiM6zzMv%2BqRSo94Fxs1TU-Z2g%40mail.gmail.com >> . >> >> For more options, visit https://groups.google.com/groups/opt_out. >> >> >> > > -- > You received this message because you are subscribed to the Google Groups > "Ruby on Rails: Talk" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To view this discussion on the web visit > https://groups.google.com/d/msgid/rubyonrails-talk/CABvThQfbk2%2Be1Pi3tQgPDfgMPaWaFAEPd%2BYgs7hgRWp3MYPJPg%40mail.gmail.com > . > > For more options, visit https://groups.google.com/groups/opt_out. > > >-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CA%2BfXU%2B3%2Bg3E%3DDSwj9cCDyFj1x40hHQKgobfA8bf-PxnEBzXkrQ%40mail.gmail.com. For more options, visit https://groups.google.com/groups/opt_out.
ip = request.remote_addr NameError: undefined local variable or method `request'' for #<Object:0xb785f950> from (irb):1 from :0 Which I am getting in irb. On Tue, Jun 18, 2013 at 12:40 PM, Loganathan Sellapa < loganathan.ms-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Can you copy your ruby script ? > > Regards, > Logan > > Sent from mobile device > On 18 Jun 2013 12:35, "sameena Khan" <emailtosameenakhan-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > >> Thanks Rafi for your reply but can I use request.remore_addr directly like >> ip = request.remote_addr in ruby. it is saying undefined request local >> vairable. >> >> >> On Tue, Jun 18, 2013 at 12:09 PM, Rafi A <rafiglitz-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >> >>> How about using *request.remote_addr ?* >>> >>> >>> Regards, >>> Seeni Rafiyullah Khan A, >>> <srkhan-E9Vo0z8jLxLQT0dZR+AlfA@public.gmane.org>** >>> >>> >>> On Tue, Jun 18, 2013 at 1:56 AM, Khan <emailtosameenakhan-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>wrote: >>> >>>> Hi all, I want to capture IP address in ruby 1.8.7 can any one help me >>>> out how to capture IP. >>>> >>>> >>>> >>>> Thanks in advance >>>> >>>> -- >>>> You received this message because you are subscribed to the Google >>>> Groups "Ruby on Rails: Talk" group. >>>> To unsubscribe from this group and stop receiving emails from it, send >>>> an email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >>>> To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >>>> To view this discussion on the web visit >>>> https://groups.google.com/d/msgid/rubyonrails-talk/7a0ea49a-cede-4bd1-b797-26f0b8c630c9%40googlegroups.com >>>> . >>>> For more options, visit https://groups.google.com/groups/opt_out. >>>> >>>> >>>> >>> >>> -- >>> You received this message because you are subscribed to the Google >>> Groups "Ruby on Rails: Talk" group. >>> To unsubscribe from this group and stop receiving emails from it, send >>> an email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >>> To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >>> To view this discussion on the web visit >>> https://groups.google.com/d/msgid/rubyonrails-talk/CA%2BfXU%2B3ngJR57FXUoHyVWPWPLfiM6zzMv%2BqRSo94Fxs1TU-Z2g%40mail.gmail.com >>> . >>> >>> For more options, visit https://groups.google.com/groups/opt_out. >>> >>> >>> >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Ruby on Rails: Talk" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >> To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/rubyonrails-talk/CABvThQfbk2%2Be1Pi3tQgPDfgMPaWaFAEPd%2BYgs7hgRWp3MYPJPg%40mail.gmail.com >> . >> >> For more options, visit https://groups.google.com/groups/opt_out. >> >> >> > -- > You received this message because you are subscribed to the Google Groups > "Ruby on Rails: Talk" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To view this discussion on the web visit > https://groups.google.com/d/msgid/rubyonrails-talk/CAD_i5MEuNpDEy4AgwwZjzk19ooBvjcaAO8_wF8VL4vsFrSh8JQ%40mail.gmail.com > . > > For more options, visit https://groups.google.com/groups/opt_out. > > >-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CABvThQdx%2BGknV%2B9JP7cxqyLYST67r53oCZ0gBxGJh7MDa7%3Dygg%40mail.gmail.com. For more options, visit https://groups.google.com/groups/opt_out.
You cannot get this value in irb.. Controller only intended to handle the request & response. Can you try that in some controller method? Regards, Seeni Rafiyullah Khan A, <srkhan-E9Vo0z8jLxLQT0dZR+AlfA@public.gmane.org>*In Every moment, thank God.* On Tue, Jun 18, 2013 at 3:35 AM, sameena Khan <emailtosameenakhan-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>wrote:> ip = request.remote_addr > NameError: undefined local variable or method `request'' for > #<Object:0xb785f950> > from (irb):1 > from :0 > Which I am getting in irb. > > > On Tue, Jun 18, 2013 at 12:40 PM, Loganathan Sellapa < > loganathan.ms-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > >> Can you copy your ruby script ? >> >> Regards, >> Logan >> >> Sent from mobile device >> On 18 Jun 2013 12:35, "sameena Khan" <emailtosameenakhan-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> >> wrote: >> >>> Thanks Rafi for your reply but can I use request.remore_addr directly >>> like >>> ip = request.remote_addr in ruby. it is saying undefined request local >>> vairable. >>> >>> >>> On Tue, Jun 18, 2013 at 12:09 PM, Rafi A <rafiglitz-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >>> >>>> How about using *request.remote_addr ?* >>>> >>>> >>>> Regards, >>>> Seeni Rafiyullah Khan A, >>>> <srkhan-E9Vo0z8jLxLQT0dZR+AlfA@public.gmane.org>** >>>> >>>> >>>> On Tue, Jun 18, 2013 at 1:56 AM, Khan <emailtosameenakhan-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>wrote: >>>> >>>>> Hi all, I want to capture IP address in ruby 1.8.7 can any one help me >>>>> out how to capture IP. >>>>> >>>>> >>>>> >>>>> Thanks in advance >>>>> >>>>> -- >>>>> You received this message because you are subscribed to the Google >>>>> Groups "Ruby on Rails: Talk" group. >>>>> To unsubscribe from this group and stop receiving emails from it, send >>>>> an email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >>>>> To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org >>>>> . >>>>> To view this discussion on the web visit >>>>> https://groups.google.com/d/msgid/rubyonrails-talk/7a0ea49a-cede-4bd1-b797-26f0b8c630c9%40googlegroups.com >>>>> . >>>>> For more options, visit https://groups.google.com/groups/opt_out. >>>>> >>>>> >>>>> >>>> >>>> -- >>>> You received this message because you are subscribed to the Google >>>> Groups "Ruby on Rails: Talk" group. >>>> To unsubscribe from this group and stop receiving emails from it, send >>>> an email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >>>> To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >>>> To view this discussion on the web visit >>>> https://groups.google.com/d/msgid/rubyonrails-talk/CA%2BfXU%2B3ngJR57FXUoHyVWPWPLfiM6zzMv%2BqRSo94Fxs1TU-Z2g%40mail.gmail.com >>>> . >>>> >>>> For more options, visit https://groups.google.com/groups/opt_out. >>>> >>>> >>>> >>> >>> -- >>> You received this message because you are subscribed to the Google >>> Groups "Ruby on Rails: Talk" group. >>> To unsubscribe from this group and stop receiving emails from it, send >>> an email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >>> To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >>> To view this discussion on the web visit >>> https://groups.google.com/d/msgid/rubyonrails-talk/CABvThQfbk2%2Be1Pi3tQgPDfgMPaWaFAEPd%2BYgs7hgRWp3MYPJPg%40mail.gmail.com >>> . >>> >>> For more options, visit https://groups.google.com/groups/opt_out. >>> >>> >>> >> -- >> You received this message because you are subscribed to the Google Groups >> "Ruby on Rails: Talk" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >> To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/rubyonrails-talk/CAD_i5MEuNpDEy4AgwwZjzk19ooBvjcaAO8_wF8VL4vsFrSh8JQ%40mail.gmail.com >> . >> >> For more options, visit https://groups.google.com/groups/opt_out. >> >> >> > > -- > You received this message because you are subscribed to the Google Groups > "Ruby on Rails: Talk" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To view this discussion on the web visit > https://groups.google.com/d/msgid/rubyonrails-talk/CABvThQdx%2BGknV%2B9JP7cxqyLYST67r53oCZ0gBxGJh7MDa7%3Dygg%40mail.gmail.com > . > > For more options, visit https://groups.google.com/groups/opt_out. > > >-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CA%2BfXU%2B2cdZ4dq9oEcKG%2B9cCML2mvmK1ukQhA3i%3DH5CjuX9FutA%40mail.gmail.com. For more options, visit https://groups.google.com/groups/opt_out.
ok Rafi Thank you On Tue, Jun 18, 2013 at 1:49 PM, Rafi A <rafiglitz-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> You cannot get this value in irb.. Controller only intended to handle the > request & response. Can you try that in some controller method? > > > Regards, > Seeni Rafiyullah Khan A, > <srkhan-E9Vo0z8jLxLQT0dZR+AlfA@public.gmane.org> > *In Every moment, thank God.* > > > On Tue, Jun 18, 2013 at 3:35 AM, sameena Khan < > emailtosameenakhan-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > >> ip = request.remote_addr >> NameError: undefined local variable or method `request'' for >> #<Object:0xb785f950> >> from (irb):1 >> from :0 >> Which I am getting in irb. >> >> >> On Tue, Jun 18, 2013 at 12:40 PM, Loganathan Sellapa < >> loganathan.ms-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >> >>> Can you copy your ruby script ? >>> >>> Regards, >>> Logan >>> >>> Sent from mobile device >>> On 18 Jun 2013 12:35, "sameena Khan" <emailtosameenakhan-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> >>> wrote: >>> >>>> Thanks Rafi for your reply but can I use request.remore_addr directly >>>> like >>>> ip = request.remote_addr in ruby. it is saying undefined request local >>>> vairable. >>>> >>>> >>>> On Tue, Jun 18, 2013 at 12:09 PM, Rafi A <rafiglitz-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >>>> >>>>> How about using *request.remote_addr ?* >>>>> >>>>> >>>>> Regards, >>>>> Seeni Rafiyullah Khan A, >>>>> <srkhan-E9Vo0z8jLxLQT0dZR+AlfA@public.gmane.org>** >>>>> >>>>> >>>>> On Tue, Jun 18, 2013 at 1:56 AM, Khan <emailtosameenakhan-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>wrote: >>>>> >>>>>> Hi all, I want to capture IP address in ruby 1.8.7 can any one help >>>>>> me out how to capture IP. >>>>>> >>>>>> >>>>>> >>>>>> Thanks in advance >>>>>> >>>>>> -- >>>>>> You received this message because you are subscribed to the Google >>>>>> Groups "Ruby on Rails: Talk" group. >>>>>> To unsubscribe from this group and stop receiving emails from it, >>>>>> send an email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >>>>>> To post to this group, send email to >>>>>> rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >>>>>> To view this discussion on the web visit >>>>>> https://groups.google.com/d/msgid/rubyonrails-talk/7a0ea49a-cede-4bd1-b797-26f0b8c630c9%40googlegroups.com >>>>>> . >>>>>> For more options, visit https://groups.google.com/groups/opt_out. >>>>>> >>>>>> >>>>>> >>>>> >>>>> -- >>>>> You received this message because you are subscribed to the Google >>>>> Groups "Ruby on Rails: Talk" group. >>>>> To unsubscribe from this group and stop receiving emails from it, send >>>>> an email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >>>>> To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org >>>>> . >>>>> To view this discussion on the web visit >>>>> https://groups.google.com/d/msgid/rubyonrails-talk/CA%2BfXU%2B3ngJR57FXUoHyVWPWPLfiM6zzMv%2BqRSo94Fxs1TU-Z2g%40mail.gmail.com >>>>> . >>>>> >>>>> For more options, visit https://groups.google.com/groups/opt_out. >>>>> >>>>> >>>>> >>>> >>>> -- >>>> You received this message because you are subscribed to the Google >>>> Groups "Ruby on Rails: Talk" group. >>>> To unsubscribe from this group and stop receiving emails from it, send >>>> an email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >>>> To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >>>> To view this discussion on the web visit >>>> https://groups.google.com/d/msgid/rubyonrails-talk/CABvThQfbk2%2Be1Pi3tQgPDfgMPaWaFAEPd%2BYgs7hgRWp3MYPJPg%40mail.gmail.com >>>> . >>>> >>>> For more options, visit https://groups.google.com/groups/opt_out. >>>> >>>> >>>> >>> -- >>> You received this message because you are subscribed to the Google >>> Groups "Ruby on Rails: Talk" group. >>> To unsubscribe from this group and stop receiving emails from it, send >>> an email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >>> To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >>> To view this discussion on the web visit >>> https://groups.google.com/d/msgid/rubyonrails-talk/CAD_i5MEuNpDEy4AgwwZjzk19ooBvjcaAO8_wF8VL4vsFrSh8JQ%40mail.gmail.com >>> . >>> >>> For more options, visit https://groups.google.com/groups/opt_out. >>> >>> >>> >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Ruby on Rails: Talk" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >> To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/rubyonrails-talk/CABvThQdx%2BGknV%2B9JP7cxqyLYST67r53oCZ0gBxGJh7MDa7%3Dygg%40mail.gmail.com >> . >> >> For more options, visit https://groups.google.com/groups/opt_out. >> >> >> > > -- > You received this message because you are subscribed to the Google Groups > "Ruby on Rails: Talk" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To view this discussion on the web visit > https://groups.google.com/d/msgid/rubyonrails-talk/CA%2BfXU%2B2cdZ4dq9oEcKG%2B9cCML2mvmK1ukQhA3i%3DH5CjuX9FutA%40mail.gmail.com > . > > For more options, visit https://groups.google.com/groups/opt_out. > > >-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CABvThQfyZMnzuQAm7MExRWpTcKQBk%2BvjUQG1TOz34eZ1B%2Bb_iw%40mail.gmail.com. For more options, visit https://groups.google.com/groups/opt_out.
Hey Khan. Here you have some examples: http://stackoverflow.com/questions/14112955/how-to-get-my-machines-ip-address-from-ruby-without-leveraging-from-other-ip-ad El martes, 18 de junio de 2013 00:56:02 UTC-5, Khan escribió:> Hi all, I want to capture IP address in ruby 1.8.7 can any one help me out > how to capture IP. > > > > Thanks in advance >-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/560ced18-a313-4387-a5f9-40fa9897c8a3%40googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.