Project

General

Profile

Actions

Bug #4868

closed

ActiveSupport::JSON.decode Fails Decoding Date/Time String

Added by tboilard (Tom Boilard) over 13 years ago. Updated over 13 years ago.

Status:
Closed
Assignee:
-
Target version:
ruby -v:
ruby 1.9.2p180 (2011-02-18 revision 30909) [x86_64-darwin10.7.4]
Backport:
[ruby-core:36955]

Description

Issuing the command...

ActiveSupport::JSON.decode('[{"created_at":"2011-06-10T18:09:09-04:00"}]')

using the rails console results in the following error...

Psych::SyntaxError: couldn't parse YAML at line 1 column 30
from /Users/tboilard/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/psych.rb:148:in parse'
from /Users/tboilard/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/psych.rb:148:inparse_stream'
from /Users/tboilard/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/psych.rb:119:in parse'
from /Users/tboilard/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/psych.rb:106:inload'
from /Users/tboilard/.rvm/gems/ruby-1.9.2-p180@rails307/gems/activesupport-3.0.7/lib/active_support/json/backends/yaml.rb:15:in decode'
from /Users/tboilard/.rvm/gems/ruby-1.9.2-p180@rails307/gems/activesupport-3.0.7/lib/active_support/json/decoding.rb:14:indecode'
from (irb):46
from /Users/tboilard/.rvm/gems/ruby-1.9.2-p180@rails307/gems/railties-3.0.7/lib/rails/commands/console.rb:44:in start'
from /Users/tboilard/.rvm/gems/ruby-1.9.2-p180@rails307/gems/railties-3.0.7/lib/rails/commands/console.rb:8:instart'
from /Users/tboilard/.rvm/gems/ruby-1.9.2-p180@rails307/gems/railties-3.0.7/lib/rails/commands.rb:23:in <top (required)>'
from script/rails:6:inrequire'
from script/rails:6:in `'

Running Rails 3.0.7 and ruby-1.9.2-p180.

Issue was discovered while updating a rails 2.3.11 app to rails 3.

Please let me know if you need any other information.

Thanks
Tom


Related issues 1 (0 open1 closed)

Is duplicate of Ruby master - Bug #4479: Psych fails to parse timestamps which is parsable by SyckThird Party's Issuetenderlovemaking (Aaron Patterson)03/08/2011Actions
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0