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.

2
  • Based on the link here it could be a non UTF-8 character: github.com/tenderlove/psych/issues/39
    – ScottJShea
    Aug 21, 2012 at 9: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? Aug 21, 2012 at 10:46

1 Answer 1

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)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.