Rails Rails 4.2 默认行为

zlx_star · 2016年01月27日 · 最后由 msg7086 回复于 2016年01月27日 · 2042 次阅读

Rails 4.2 以后 server 默认监听 localhost 而不是之前的 0.0.0.0

要使用原先的 0.0.0.0,可以这样启动:rails s -b 0.0.0.0

今天被小坑了一把,附上相关 Release Note http://edgeguides.rubyonrails.org/4_2_release_notes.html#default-host-for-rails-server

Due to a change in Rack postmodern committed on Feb 10, 2013

已经快 3 年过去了。

😄 之前不是遇到过了么?

#1 楼 @msg7086 #2 楼 @hz_qiuyuanxin 惭愧,之前一直在本机调试,所以没发现。

需要 登录 后方可回复, 如果你还没有账号请 注册新账号