On rails-server machine:
- Make sure you're running rails-server.
- Get your IP address, I got "192.168.1.112" for example.
On mobile:
Access through browser by using:
http://<your_ip_address>:3000
http://192.168.1.112:3000
NOTE: Your mobiles need to have the same network with rails-server machine.
To get yourself IP address, run this command in your rails-server machine.
MacOS or Linux Terminal:
ipconfig getifaddr en0 || ipconfig getifaddr en1
# => 192.168.1.112
Description:
ipconfig getifaddr en0
is for wifi connections
ipconfig getifaddr en1
is for wired connections
Windows:
ipconfig
Then looking for IPv4 Address
.
Running rails-server
On rails-server machine, it's okay to regularly run:
bin/rails s
If you found issue, you can try the following:
bin/rails s -b 0.0.0.0
Note: 0.0.0.0
is not an IP address, it's a shortcut for the system binding call to use all available IP addresses including 127.0.0.1
, localhost
.
Access through http://localhost:3000/