MultiJson :: DecodeError:399:意外的令牌at

时间:2012-01-26 13:07:36

标签: ruby-on-rails ruby-on-rails-3 json activeresource activesupport

这是我的代码

class Project < ActiveResource::Base
  self.site = "https://xyz.unfuddle.com/api/v1"
  def get_tickets
    ticket_array = []
    Project.all.each do |project|
      project.get(:tickets).each do |ticket|
        #save ticket or something
      end
    end
  end   
end  

project.get(:tickets)

中发生错误
lexical error: invalid character inside string.
 16           ": "There is text that shouldn^Zt be there on the DVD/Blu-ray
 17                      (right here) ------^

如果返回的文本只有有效字符,我该如何检查?

1 个答案:

答案 0 :(得分:1)

你需要获取数据。否则你将无法检查它的有效性。这就是为什么我只想添加一个try-catch-block并解决特定的错误。