我在
Ruby 2.2.1上安装了active_support 4.2,所以我想使用它
Time.zone.parse('2007-02-10 15:30:45')
如下所述:http://api.rubyonrails.org/classes/ActiveSupport/TimeWithZone.html
但即使在需要active_support和active_support / time_with_zone之后,我似乎仍然无法使用Time.zone.注意:
2.2.1 :002 > require "active_support" => true 2.2.1 :003 > Time.zone NoMethodError: undefined method `zone' for Time:Class 2.2.1 :004 > require "active_support/time_with_zone" => true 2.2.1 :005 > Time.zone NoMethodError: undefined method `zone' for Time:Class
这是怎么回事?