I am trying to get the hostname of the machine which a rails application is running on from the controller.
What would be the best way to do this taking into account
Use backticks and the command hostname
hostname
current_host = `hostname`
This sends the command to the shell, and returns the hostname. Works on at least: Debian Linux, Windows, Solaris.