how do i run a development rails app / website on an ipod
I'm providing an update for anyone who's using Rails 4, has followed the steps in the accepted answer, and still can't connect to the app via development_machine_ip:3000
. The reason being that somewhere around version 4, Rails changed the default binding address from 0.0.0.0
to only localhost
. By default this allows you to only access the Rails app via localhost:3000
or 127.0.0.1:3000
- which is fine in most cases.
Now if you'd like to access the app from a different device on your network, you can use the -b
option when starting the server and specify a binding address of 0.0.0.0
rails s -b 0.0.0.0
This will bind on ALL interfaces including localhost and the IP assigned by your network. You should now be able to access the app via development_machine_ip:3000
.
I am hoping that your macbook and iPad are on same network. Now go to "Open network preference". Check screenshot.
You will see an ip.
then from ipad open: your_ip:3000
I use proxylocal ngrok for this:
$ ngrok http 3000ngrok by @inconshreveable (Ctrl+C to quit)Session Status onlineAccount Sergio (Plan: Free)Version 2.2.8Region United States (us)Web Interface http://127.0.0.1:4040Forwarding http://be278635.ngrok.io -> localhost:3000Forwarding https://be278635.ngrok.io -> localhost:3000Connections ttl opn rt1 rt5 p50 p90 0 0 0.00 0.00 0.00 0.00
Now you can open http://be278635.ngrok.io from your ipad without worrying about your machine's ip address.