端口转发、渲染控制台警告 — Rails v4.2.6

端口转发、渲染控制台警告 — Rails v4.2.6

本地路由器上的转发端口192.168.1.4:3000允许使用我的 IP 地址进行公共访问。

查看我的 Rails 应用程序时 @http://47.145.229.103:3000/一切都显示正确,但除了 localhost:3000 之外的任何访问点都会出现控制台渲染警告。

通过 localhost 查看时:3000

WayyLoww:~/Development/Rails/Syn$ bin/rails s -b 0.0.0.0 -p 3000
=> Booting WEBrick
=> Rails 4.2.6 application starting in development on http://0.0.0.0:3000
=> Run `rails server -h` for more startup options
=> Ctrl-C to shutdown server
[2016-10-11 00:38:31] INFO  WEBrick 1.3.1
[2016-10-11 00:38:31] INFO  ruby 2.3.1 (2016-04-26) [x86_64-darwin16]
[2016-10-11 00:38:31] INFO  WEBrick::HTTPServer#start: pid=5932 port=3000


Started GET "/" for 127.0.0.1 at 2016-10-11 00:38:34 -0700
  ActiveRecord::SchemaMigration Load (0.1ms)  SELECT "schema_migrations".* FROM "schema_migrations"
Processing by VisitorsController#index as HTML
  Rendered visitors/index.html.erb within layouts/application (2.0ms)
  Rendered layouts/_navigation_links.html.erb (1.3ms)
  Rendered layouts/_nav_links_for_auth.html.erb (3.6ms)
  Rendered layouts/_navigation.html.erb (7.8ms)
  Rendered layouts/_messages.html.erb (0.5ms)
  Rendered layouts/_footer.html.erb (0.3ms)
Completed 200 OK in 243ms (Views: 234.2ms | ActiveRecord: 0.0ms)

通过IP地址查看时

Started GET "/" for 47.145.229.103 at 2016-10-11 00:41:32 -0700
Cannot render console from 47.145.229.103! Allowed networks: 127.0.0.1, ::1, 127.0.0.0/127.255.255.255
Processing by VisitorsController#index as HTML
  Rendered visitors/index.html.erb within layouts/application (0.8ms)
  Rendered layouts/_navigation_links.html.erb (0.9ms)
  Rendered layouts/_nav_links_for_auth.html.erb (0.3ms)
  Rendered layouts/_navigation.html.erb (4.1ms)
  Rendered layouts/_messages.html.erb (0.1ms)
  Rendered layouts/_footer.html.erb (0.0ms)
Completed 200 OK in 75ms (Views: 74.7ms | ActiveRecord: 0.0ms)

如果一切都正确加载,为什么会出现此渲染控制台错误,以及需要采取什么措施来纠正此错误?

相关内容