【发布时间】:2012-09-22 00:00:28
【问题描述】:
我正在尝试动态地重新定义 gem 的常量,因此我不需要修改 gem 本身。
require 'xmlrpc/client'
XMLRPC::Config.const_set("ENABLE_NIL_PARSER", true)
warning: already initialized constant ENABLE_NIL_PARSER
是否有可能摆脱警告?
【问题讨论】:
-
为什么要摆脱它?或者,更确切地说,抑制它就足够了,还是你真的不希望它发生?
-
我已经看到了 Josh 提到的帖子,但在我的情况下它不起作用。它抱怨 `const_defined?': false is not a symbol (TypeError)