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,113
  • 3
  • 23
  • 42
William Hu
  • 14,400
  • 9
  • 91
  • 112

2 Answers2

5

For Rails 5:

$ rails s -b 0.0.0.0
Lane
  • 4,112
  • 1
  • 31
  • 18
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,113
  • 3
  • 23
  • 42