我目前在我的Mac OS上安装了Debian虚拟机,在其中安装了Ruby 2.4.0。我使用VirtualBox和流浪在虚拟机上托管一个rails服务器
首先,我无法启动我的服务器这样rails server
,因为当我尝试访问它在我的Mac OS的Web浏览器,我有这样的错误:
The localhost page isn’t working
localhost didn’t send any data.
所以,我要推出这样说:rails server -b 0.0.0.0
但我不知道为什么我无法启动它127.0.0.1(默认IP)
而且,这里是我有当消息我是l开始我的Rails服务器。
/usr/local/lib/ruby/gems/2.4.0/gems/activesupport-
5.0.1/lib/active_support/xml_mini.rb:51: warning: constant ::Fixnum is deprecated
/usr/local/lib/ruby/gems/2.4.0/gems/activesupport-5.0.1/lib/active_support/xml_mini.rb:52: warning: constant ::Bignum is deprecated
=> Booting Puma
=> Rails 5.0.1 application starting in development on http://0.0.0.0:3000
=> Run `rails server -h` for more startup options
/usr/local/lib/ruby/gems/2.4.0/gems/activesupport-5.0.1/lib/active_support/core_ext/numeric/conversions.rb:138: warning: constant ::Fixnum is deprecated
Puma starting in single mode...
* Version 3.7.1 (ruby 2.4.0-p0), codename: Snowy Sagebrush
* Min threads: 5, max threads: 5
* Environment: development
* Listening on tcp://0.0.0.0:3000
虽然我知道,过时的东西警告相关的事实,我使用Ruby的最新版本,我不明白,最后5行:
Puma starting in single mode...
* Version 3.7.1 (ruby 2.4.0-p0), codename: Snowy Sagebrush
* Min threads: 5, max threads: 5
* Environment: development
* Listening on tcp://0.0.0.0:3000
你能向我解释这些的含义?
最后但并非最不重要,当我去http://0.0.0.0:3000,即使我有正确的显示(Yay!你在轨道上!)我在控制台上有这个奇怪的消息。
Started GET "/" for 10.0.2.2 at 2017-02-25 23:42:38 +0000
Cannot render console from 10.0.2.2! Allowed networks: 127.0.0.1, ::1, 127.0.0.0/127.255.255.255
Processing by Rails::WelcomeController#index as HTML
Parameters: {"internal"=>true}
Rendering /usr/local/lib/ruby/gems/2.4.0/gems/railties-5.0.1/lib/rails/templates/rails/welcome/index.html.erb
Rendered /usr/local/lib/ruby/gems/2.4.0/gems/railties-5.0.1/lib/rails/templates/rails/welcome/index.html.erb (1.6ms)
Completed 200 OK in 10ms (Views: 4.2ms | ActiveRecord: 0.0ms)
你能解释一下如何解决这个问题:Cannot render console from 10.0.2.2! Allowed networks: 127.0.0.1, ::1, 127.0.0.0/127.255.255.255
?
谢谢!