Hi John, On Thu, 2009-09-24 at 10:22 -0700, johnr wrote: > In the environment.rb I need to use the port number that the server is > being started under in an after_initialize block in order to register > my server with another server. I've looked in config > (Rails:Configuration) and ENV, but It doesn't look to be there. I know > that a workaround would be to set a PORT environment variable and use > that on the command line, for example. But I would rather use an > already existent method.
On a request-by-request basis you can test request.host_with_port. But, AFAIK, Rails is unaware of the port used by the web server until that server makes a request. If it were otherwise, it would be difficult to run a pack of mongrels in front of the app. Perhaps if you said more about what you mean by 'register my server with another server', we could be more help. HTH, Bill --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---

