I wanted to access the local Rails app on my Mac on my iPhone. I was able to connect more easily than I imagined.
Mac and iPhone must be connected to the same Wi-Fi
Check the IP address with the apple mark → System Preferences → Network → Details → TCP / IP.
Start the Rails server by specifying the IP address confirmed in step 1.
$ rails s -b <IP address>
Specify the IP address by using the -b option
Enter the following in the iPhone browser.
http://111.111.111.1:3000/
Access port 3000 with: 3000. Rails defaults to 3000.
If you make a mistake or make a strange statement, please feel free to comment!
Recommended Posts