如何禁用“无法从...渲染控制台"在轨道上 [英] How to disable "Cannot Render Console from..." on Rails

查看:63
本文介绍了如何禁用“无法从...渲染控制台"在轨道上的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用 Ubuntu/vagrant 作为我的开发环境.我在 rails 控制台上收到这些消息:

I'm using Ubuntu/vagrant as my development environment. I'm getting these messages on rails console:

Started GET "/assets/home-fcec5b5a277ac7c20cc9f45a209a3bcd.js?body=1" for 10.0.2.2 at 2015-04-02 15:48:31 +0000
Cannot render console from 10.0.2.2! Allowed networks: 127.0.0.1, ::1, 127.0.0.0/127.255.255.255

是否可以禁用那些无法呈现..."消息或以任何方式允许它们?

Is it possible to disable those "cannot render..." messages or allow them in any way?

推荐答案

您需要在 Web 控制台配置中明确允许 10.0.2.2 网络空间.

You need to specifically allow the 10.0.2.2 network space in the Web Console config.

所以你会想要这样的:

class Application < Rails::Application
  config.web_console.permissions = '10.0.2.2'
end

阅读此处了解更多信息.

正如指出通过 pguardiario,这要进入 config/environments/development.rb 而不是 >config/application.rb 所以它只适用于你的开发环境.

As pointed out by pguardiario, this wants to go into config/environments/development.rb rather than config/application.rb so it is only applied in your development environment.

这篇关于如何禁用“无法从...渲染控制台"在轨道上的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆