Erwin wrote:
> I would like to get in a variable the ip address of the host where my
> app is running, to change some parameters if it's running locally or
> remotely .. is it possible ?
You can try
require 'socket'
REAL_PRODUCTION = Socket.gethostname == 'mysite.com'
or
hostinfo = Socket.gethostbyname(Socket.gethostname)
hostnames = hostinfo[1] << hostinfo[0]
REAL_PRODUCTION = hostnames.include?('mysite.com')
--
Rails Wheels - Find Plugins, List & Sell Plugins - http://railswheels.com
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---