If you have worked on making a website that isn’t complete garbage, you
have probably worried about what it looks on mobile. So I’ll show you
the real quick and easy way to connect to your local server from your
mobile device.

  • Ensure both devices are on the same network

  • Then start your rails server using the following command

rails s -b 0.0.0.0

Mac

  • Open Network preferences and find your local IP

Linux

To find your Local IP

Use ifconfig to find your inet address.

ifconfig

or if you’re lazy you can use this command that gets rid of the stuff that
doesn’t matter in this case.

ifconfig | grep 'inet addr:' | cut -d: -f2 | awk '{ print $1}' `

Windows

LOL … plz.

Finally

Then open your mobile browser and go to YOUR_IP:3000