Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

can not access local rails server

I build up a rails app in mac OS and try to use other device (in same private lan) to connect to this local service. However my device can not access to this url => "http://192.168.1.107:3000"

My console is below:

chris$ rails server --binding=192.168.1.107
=> Booting WEBrick
=> Rails 4.2.0 application starting in development on http://192.168.1.107:3000
=> Run `rails server -h` for more startup options
=> Ctrl-C to shutdown server

It works fine in local machine both "http://localhost:3000" and "http://192.168.1.107:3000" but other device still can not access "http://192.168.1.107:3000"

Any suggestion for that? thanks a lot!

like image 878
CWC Avatar asked Dec 23 '15 15:12

CWC


1 Answers

Try this:

rails server -b 0.0.0.0 -p 3000

If firewall blocks 3000 try this:

rails server -b 0.0.0.0 -p 80

Now access [your-computer-ip]:80

You could also use a service like https://localtunnel.me/ (if you are not on the same local domain)

like image 184
Laurens Avatar answered Sep 22 '22 13:09

Laurens