如何解决activesupport 3.0.0与2.x相比的行为差异?

我在我的Sinatra应用程序中使用Hash#to_xml。 它确实有效,直到我转移到actviesupport 3.0.0

3.0.0中activesupport的使用有区别吗?

例如,这很好

gem 'activesupport', '2.3.5' require 'active_support' {}.to_xml 

 gem 'activesupport', '3.0.0' require 'active_support' {}.to_xml 

generate:NoMethodError:{}的未定义方法`to_xml’:哈希

ActiveSupport在您require时不再加载其所有组件。 这使您可以选择所需的function。

 require "active_support/core_ext/hash/conversions" {}.to_xml 

或者如果你真的想要所有的ActiveSupport:

 require "active_support/all"