如何隐藏soap4r gem警告

时间:2011-04-25 12:58:09

标签: soap soap4r

我在soap4r gem的帮助下编写了访问magento核心api的ruby代码。当我运行代码时它运行得很好,但问题是它应该给出大量的肥皂警告。

/home/chandru/.rvm/gems/ruby-1.9.2-p0/gems/soap4r-1.5.8/lib/xsd/charset.rb:13: warning: variable $KCODE is no longer effective
/home/chandru/.rvm/gems/ruby-1.9.2-p0/gems/soap4r-1.5.8/lib/soap/property.rb:68: warning: encoding option is ignored - u
/home/chandru/.rvm/gems/ruby-1.9.2-p0/gems/soap4r-1.5.8/lib/soap/property.rb:69: warning: encoding option is ignored - u
/home/chandru/.rvm/gems/ruby-1.9.2-p0/gems/soap4r-1.5.8/lib/soap/property.rb:70: warning: encoding option is ignored - u
/home/chandru/.rvm/gems/ruby-1.9.2-p0/gems/soap4r-1.5.8/lib/soap/rpc/element.rb:226: warning: Hash#index is deprecated; use Hash#key
/home/chandru/.rvm/gems/ruby-1.9.2-p0/gems/soap4r-1.5.8/lib/soap/rpc/element.rb:226: warning: Hash#index is deprecated; use Hash#key
/home/chandru/.rvm/gems/ruby-1.9.2-p0/gems/soap4r-1.5.8/lib/soap/rpc/element.rb:226: warning: Hash#index is deprecated; use Hash#key
/home/chandru/.rvm/gems/ruby-1.9.2-p0/gems/soap4r-1.5.8/lib/soap/rpc/element.rb:226: warning: Hash#index is deprecated; use Hash#key
/home/chandru/.rvm/gems/ruby-1.9.2-p0/gems/soap4r-1.5.8/lib/soap/rpc/element.rb:226: warning: Hash#index is deprecated; use Hash#key
/home/chandru/.rvm/gems/ruby-1.9.2-p0/gems/soap4r-1.5.8/lib/soap/rpc/element.rb:226: warning: Hash#index is deprecated; use Hash#key
/home/chandru/.rvm/gems/ruby-1.9.2-p0/gems/soap4r-1.5.8/lib/soap/rpc/element.rb:226: warning: Hash#index is deprecated; use Hash#key
/home/chandru/.rvm/gems/ruby-1.9.2-p0/gems/soap4r-1.5.8/lib/soap/rpc/element.rb:226: warning: Hash#index is deprecated; use Hash#key
/home/chandru/.rvm/gems/ruby-1.9.2-p0/gems/soap4r-1.5.8/lib/soap/rpc/element.rb:226: warning: Hash#index is deprecated; use Hash#key
/home/chandru/.rvm/gems/ruby-1.9.2-p0/gems/soap4r-1.5.8/lib/soap/rpc/element.rb:226: warning: Hash#index is deprecated; use Hash#key
/home/chandru/.rvm/gems/ruby-1.9.2-p0/gems/soap4r-1.5.8/lib/soap/rpc/element.rb:226: warning: Hash#index is deprecated; use Hash#key
/home/chandru/.rvm/gems/ruby-1.9.2-p0/gems/soap4r-1.5.8/lib/soap/rpc/element.rb:226: warning: Hash#index is deprecated; use Hash#key
/home/chandru/.rvm/gems/ruby-1.9.2-p0/gems/soap4r-1.5.8/lib/soap/rpc/element.rb:226: warning: Hash#index is deprecated; use Hash#key
/home/chandru/.rvm/gems/ruby-1.9.2-p0/gems/soap4r-1.5.8/lib/soap/rpc/element.rb:226: warning: Hash#index is deprecated; use Hash#key
/home/chandru/.rvm/gems/ruby-1.9.2-p0/gems/soap4r-1.5.8/lib/soap/rpc/element.rb:226: warning: Hash#index is deprecated; use Hash#key
/home/chandru/.rvm/gems/ruby-1.9.2-p0/gems/soap4r-1.5.8/lib/soap/rpc/element.rb:226: warning: Hash#index is deprecated; use Hash#key
/home/chandru/.rvm/gems/ruby-1.9.2-p0/gems/soap4r-1.5.8/lib/soap/rpc/element.rb:226: warning: Hash#index is deprecated; use Hash#key
/home/chandru/.rvm/gems/ruby-1.9.2-p0/gems/soap4r-1.5.8/lib/soap/rpc/element.rb:226: warning: Hash#index is deprecated; use Hash#key
/home/chandru/.rvm/gems/ruby-1.9.2-p0/gems/soap4r-1.5.8/lib/soap/rpc/element.rb:226: warning: Hash#index is deprecated; use Hash#key
/home/chandru/.rvm/gems/ruby-1.9.2-p0/gems/soap4r-1.5.8/lib/soap/rpc/element.rb:226: warning: Hash#index is deprecated; use Hash#key
/home/chandru/.rvm/gems/ruby-1.9.2-p0/gems/soap4r-1.5.8/lib/soap/rpc/element.rb:226: warning: Hash#index is deprecated; use Hash#key
/home/chandru/.rvm/gems/ruby-1.9.2-p0/gems/soap4r-1.5.8/lib/soap/rpc/element.rb:226: warning: Hash#index is deprecated; use Hash#key
/home/chandru/.rvm/gems/ruby-1.9.2-p0/gems/soap4r-1.5.8/lib/soap/rpc/element.rb:226: warning: Hash#index is deprecated; use Hash#key
/home/chandru/.rvm/gems/ruby-1.9.2-p0/gems/soap4r-1.5.8/lib/soap/rpc/element.rb:226: warning: Hash#index is deprecated; use Hash#key
/home/chandru/.rvm/gems/ruby-1.9.2-p0/gems/soap4r-1.5.8/lib/soap/rpc/element.rb:226: warning: Hash#index is deprecated; use Hash#key
/home/chandru/.rvm/gems/ruby-1.9.2-p0/gems/soap4r-1.5.8/lib/soap/rpc/element.rb:226: warning: Hash#index is deprecated; use Hash#key
/home/chandru/.rvm/gems/ruby-1.9.2-p0/gems/soap4r-1.5.8/lib/soap/rpc/element.rb:226: warning: Hash#index is deprecated; use Hash#key

我得到了上述警告。 所以任何人都告诉我如何隐藏这些警告。 感谢。

3 个答案:

答案 0 :(得分:1)

soap4r在Ruby 1.9中存在许多已知问题。您应该考虑使用其中一个较新的SOAP工具包,例如savonhandsoap

答案 1 :(得分:0)

考虑使用soap4r-spox gem

答案 2 :(得分:0)

您可以设置$VERBOSE=nil,所有警告都会消失。