So I would like my Rails app instances to register themselves on a "I'm up" kind of thing I'm playing with, and I'd like it to be able to mention what local port it's running on. I can't seem to find how to do it - in fact just finding out its IP is tricky and needs a bit of a hack.
But no problem, I have the IP - but how can I find what port my mongrel/thin/webrick server is running on?
To be super explicit, if I start a rails app using script/server -p 3001, what can I do to pull that 3001 inside the app.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…