Rails 局域网中的手机访问 rails server 方法

caiqinghua · April 24, 2015 · Last by hbin replied at April 28, 2015 · 3960 hits

rails s http://localhost:3000 访问正常 本机 ip 为 192.168.1.102 本机或手机访问 http://192.168.1.102:3000 访问不成功

解决方法 rails s -b 192.168.1.102 http://192.168.1.102:3000 局域网中的电脑和手机都可以访问 rails server 了。

baidu: rails 局域网 访问 https://ruby-china.org/topics/889

-b 0.0.0.0

-b 0.0.0.0 之后,这样 localhost:3000 和 ip:3000 均可以访问

#2 楼 @zyjloveher 为什么会被管理员设置为 NoPoint?

#1 楼 @doitian 很久没见 doitian 了

You need to Sign in before reply, if you don't have an account, please Sign up first.