Comments (2)
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.
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)
- Error loading Psych gem specification on Ruby 3.2.2 HOT 1
- YAML string in exponential format cannot be loaded by YAML 1.2 parser
- Psych::BadAlias error with simple alias HOT 1
- Version 4.0.5 breaks Date deserialization HOT 1
- JSON is invalid
- Dates with five digit years throw exception HOT 1
- Prevent snakeYAML add backslash when dump multiple line string HOT 1
- YAML.dump(date) generates warnings with Rails 7.0.7+ HOT 1
- [DOC] Link fragment does not work
- YAML 1.2 compliance possibly breaking VCR HOT 3
- Add settings for alias limits, recursion, and duplicate keys HOT 8
- TypeError: allocator undefined for Nokogiri::HTML5::Document on YAML.unsafe_load_file HOT 3
- Psych 5.1.1 fails to load on JRuby 9.x HOT 10
- Singleton Classes Aren't round-trippable
- Issue between psych and mini_racer on platform x86_64-linux HOT 1
- Psych::DisallowedClass when loading fixtures HOT 3
- Strange `FrozenError` on `Psych.load` HOT 1
- Kernel.y interferes with code relying on method_missing HOT 3
- SSL issues preventing installation HOT 1
- yaml parsing is wrong when key's value has leading colon HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from psych.