I am setting up a RoR development environment on a Windows machine. I was wondering how I can set it up so a few friends of mine can have access to the web server and monitor the progress?
It would only be 2 or 3 people connecting at anytime time max.
The simplest way requires NO additional installations: just add a single option to your rails server
(or rails s
) command when you start up the server:
rails s --binding=0.0.0.0
The 0.0.0.0
address means "listen to requests from anywhere." On many systems, the default is 127.0.0.1
, which means "listen to requests from localhost only."
(If you don't also specify a -p
or --port
option, then the port shall be 3000
, as usual.)
You can tell your development server to listen on your publicly accessible interface:
If you're running a server via rails server
, you can specify the IP to listen on via -b <ip>
or --binding=<ip>
. By default, the server listens on 0.0.0.0, that is, only for local connections.
Usage: rails server [mongrel, thin, etc] [options] -p, --port=port Runs Rails on the specified port. Default: 3000 -b, --binding=ip Binds Rails to the specified ip. Default: 0.0.0.0
You can instead find out what your machine's network address is and bind to that address instead, but you will have to forward ports and figure out what your publicly routable IP address is on the Internet; this is outside the bounds of Stack Overflow.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With