From: "Jesús Gabriel y Galán" Date: 2010-05-07T04:37:32+09:00 Subject: Re: request.env['HTTP_USER_AGENT'] On Thu, May 6, 2010 at 9:17 PM, Mmcolli00 Mom wrote: > Hi > > I just want to do a simple output on my machine showing the ie browser. > Every example of request.env['HTTP_USER_AGENT'] that I have seen shows > no gem requirement. However, when I try to run this on my computer, I am > getting the error below. Do you know what I am doing wrong here? Thanks > MC > > puts request.env['HTTP_USER_AGENT'].gsub(/\/| /, '') > > Error: > browserVersion.rb:3: undefined local variable or method `request' for > main:Object (NameError) The request object is usually something a web framework gives you. You don't have a request for a regular ruby program. You should run that piece of code inside the scope of a request initiated by a browser to a URL served by your web server. Jesus.