An easy way to connect your Rails server to your phone
Last updated on December 20, 2021
There are products such as ngrok which expose your localhost to the web, so you can access it on another machine, for example, another laptop or your phone. However, I often find that this method is an overkill for simple testing.
Search for Network Utility and make a record of your IP address.
Another way to find your IP address is to click on the wifi icon in the menu bar with the option key pressed down. This will give you access to a bunch of information, including your IP address.
Start your server using:
1rails server -b 0.0.0.0
This will allow you to access your Rails server from a different machine. You can read more about it here.
Using your IP address, access your Rails server on another machine using
Level up your web development skills
Get articles, guides and interviews right in your inbox. Join a community of fellow developers.
No spam. Unsubscribe at any time.