Forum: Ruby on Rails Obtaining the name of the host in environment.rb

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
548240c1431285c235ecf711293a7311?d=identicon&s=25 Yash (Guest)
on 2006-05-01 18:48
For testing purposes, we deploy our app on different PCs. In the
environment.rb file , we would like to set a constant to the name and
port of the host. Is there a function that we can call to obtain the
host and port when called from environment.rb?
Ideally we want something like

Remember, we cannot use ActionController#host_with_port because we are
not in an action.

This topic is locked and can not be replied to.