Why does Ruby on Rails use http://0.0.0.0:3000 instead of http://localhost:3000?

后端 未结 8 1390
醉话见心
醉话见心 2020-12-13 04:00

I am very new to Ruby on Rails so when I tried to follow the official \"Getting Started\" ruby on rails tutorial, I was a bit disappointed

8条回答
  •  青春惊慌失措
    2020-12-13 04:40

    If you want localhost, one quick way is to specify the binding rails s -blocalhost (and the port with -pNNNN, more options with rails s --help).

    My server started running by default on localhost for reasons to be investigated. As a result lvh.me stopped working, preventing me from specifying subdomains (eg: www.lvh.me:3000).

    I "solved" this specifying the binding:

    rails s -b0.0.0.0 # will work with lvh.me
    

提交回复
热议问题