4

Could anyone point me in the right direction, as when I save a small serialized hash via file upload to the database it works just fine, however when a large file comes along it errors out with;

expected SCALAR, SEQUENCE-START, MAPPING-START, or ALIAS

Im running Ruby 1.9.3po and rails 3.2.3, sQlite3. Database column is TEXT type with default limit. Using serialize, :db_column, Hash to save it correctly as a hash to the db.

I can't find anything decisive on google. Could it be something to do with how the database column is configured? Any pointers would be greatly appreciated.

dodgerogers747
  • 3,325
  • 9
  • 34
  • 55
  • Based on the link here it could be a non UTF-8 character: https://github.com/tenderlove/psych/issues/39 – ScottJShea Aug 21 '12 at 09:08
  • The files im trying to upload are text files with just letters in them, then converting into a hash, maybe the hash syntax is invalid UTF-8? – dodgerogers747 Aug 21 '12 at 10:46

1 Answers1

1

For me this error occured while working with delayed job. i had following in my rails model:

model MyModel < ActiveRecord::Base

  handle_asynchronously :enqueue

  def enqueue
  end

end

enqueue is reserved word in DJ, thus it was failing to fire and caused above error(and lot of headache until i found out what's going on)

Pavel K.
  • 6,697
  • 8
  • 49
  • 80