使用Rails 3.2.21和Ruby 2.2.0p0时区解析器被破坏.使用Ruby 2.1.2,这工作得很好.
[1] pry(main)> Time.zone.parse("2015-01-12")
NoMethodError: undefined method `year' for nil:NilClass
from /Users/user/.rvm/gems/ruby-2.2.0/gems/activesupport-3.2.21/lib/active_support/values/time_zone.rb:275:in `parse'
Run Code Online (Sandbox Code Playgroud)
现在我知道您可以替换它,Time.parse("2015-01-12").localtime但这会破坏我的应用程序中的功能.对此有任何已知的修复方法吗?