3

I start a Rails application and access http://127.0.0.1:3000 it works, but if i access http://192.168.0.59:3000 it's not. My Mac's ip address is 192.168.0.59

I think it works before. I want to use my iPhone to access my mac as a local server in a same intern network. Any hint?

EDIT: Yeah, it's because rails server bind 127.0.0.1 so only my own machine can assess, so rails s -b 0.0.0.0. Because i used shotgun so shotgun -o 0.0.0.0

Sumit Maingi
  • 2,173
  • 3
  • 24
  • 44
William Hu
  • 15,423
  • 11
  • 100
  • 121

2 Answers2

5

For Rails 5:

$ rails s -b 0.0.0.0
Lane
  • 4,682
  • 1
  • 36
  • 20
1

you might want to check if the Rails server is bound to that IP address i.e. listening to incoming calls from there.

You can probably find your answer here: How to change the default binding ip of Rails 4.2 development server?

Community
  • 1
  • 1
Sumit Maingi
  • 2,173
  • 3
  • 24
  • 44