Giter Site home page Giter Site logo

Comments (2)

tenderlove avatar tenderlove commented on July 28, 2024

I can't seem to reproduce this. Can you try with the latest psych gem? Make sure to do gem "psych" before requiring it.

from psych.

tadman avatar tadman commented on July 28, 2024

You're right in that it doesn't happen on the current release of psych, 1.2.2 from what I can tell, but you need to declare the gem dependency or it won't happen.

If ActiveRecord listed psych as a dependency this would've been avoided because, presumably, it would have fetched the most recent version. The one bundled with Ruby 1.9.2-p290 is, sadly, broken. It has to be manually added in the Gemfile to fix this.

Ruby 1.9.3-p0 is bundled with Psych 1.2.1 which produces a slightly different error, but at least no hard crash:

/opt/local/rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/psych/visitors/emitter.rb:24:in `scalar': expected SCALAR, SEQUENCE-START, MAPPING-START, or ALIAS (RuntimeError)
    from /opt/local/rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/psych/visitors/emitter.rb:24:in `visit_Psych_Nodes_Scalar'
    from /opt/local/rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/psych/visitors/visitor.rb:15:in `visit'
    from /opt/local/rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/psych/visitors/visitor.rb:5:in `accept'
    from /opt/local/rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/psych/visitors/emitter.rb:29:in `block in visit_Psych_Nodes_Sequence'
    from /opt/local/rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/psych/visitors/emitter.rb:29:in `each'
    from /opt/local/rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/psych/visitors/emitter.rb:29:in `visit_Psych_Nodes_Sequence'
    from /opt/local/rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/psych/visitors/visitor.rb:15:in `visit'
    from /opt/local/rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/psych/visitors/visitor.rb:5:in `accept'
    from /opt/local/rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/psych/visitors/emitter.rb:19:in `block in visit_Psych_Nodes_Document'
    from /opt/local/rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/psych/visitors/emitter.rb:19:in `each'
    from /opt/local/rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/psych/visitors/emitter.rb:19:in `visit_Psych_Nodes_Document'
    from /opt/local/rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/psych/visitors/visitor.rb:15:in `visit'
    from /opt/local/rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/psych/visitors/visitor.rb:5:in `accept'
    from /opt/local/rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/psych/visitors/emitter.rb:13:in `block in visit_Psych_Nodes_Stream'
    from /opt/local/rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/psych/visitors/emitter.rb:13:in `each'
    from /opt/local/rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/psych/visitors/emitter.rb:13:in `visit_Psych_Nodes_Stream'
    from /opt/local/rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/psych/visitors/visitor.rb:15:in `visit'
    from /opt/local/rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/psych/visitors/visitor.rb:5:in `accept'
    from /opt/local/rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/psych/nodes/node.rb:46:in `to_yaml'
    from /opt/local/rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/psych.rb:190:in `dump'
    from naive.rb:11:in `<main>'

The 1.2.2 version is fine in 1.9.3, though.

Thanks for the prompt reply. It would be great if the next build of 1.9.3 will have 1.2.2 or better bundled with it as this is probably going to hit more than a few unsuspecting people.

from psych.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.