I have a app / site that i am running on my local imac and i want to test it on my ipad browser.
Can connect to my imac localhost rails app throught the wifi with my ipad ? If so how!! ?
My app is a multi tenant app that uses subdomains and so i use the hosts file on my my to point for example achme.mycompany.dev to localhost.
How do i do this on the ipad to goto achme.mycompany.dev in the browser and it runs the local app on my imac ?
Hope this all makes sense! Please help.
best regards Rick
Go to your browser and open http://localhost:3000, you will see a basic Rails app running. You can also use the alias "s" to start the server: bin/rails s . The server can be run on a different port using the -p option. The default development environment can be changed using -e .
Thanks to RubyMotion, your Ruby developers can write iOS and Android apps, today. Ruby makes programmers happy and productive, and by sharing the same language across platforms you get to reuse code, save time, and ship faster.
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'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
.
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