我目前在我的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
?
謝謝!