Rails Rails 应用在虚拟机里 Ubuntu Server 跑起来了,但是本地主机无法访问是什么原因?

gsky · March 18, 2015 · Last by huopo125 replied at March 19, 2015 · 2246 hits

我用 virtualbox 搭了个 ubuntu server , 在上面启动了 rails 应用:

但是在本地主机无法访问:

本地主机可以 ping 通虚拟机:

这是什么原因造成的呢?

rails server -b 0.0.0.0 原因:rails 4.2.0 release note 里面搜索 rails server

😄,添加个原因,以备后用:

Running Rack apps on 0.0.0.0 in development mode will allow malicious users on the local network (exf: a Coffee Shop or a Conference) to abuse or potentially exploit the app.Safer to default host to localhost when in development mode.

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