ruby / psych

A libyaml wrapper for Ruby
MIT License
566 stars 206 forks source link

EJSON Failing to Parse Special Characters Through Psych #674

Closed RailsCod3rFuture closed 4 months ago

RailsCod3rFuture commented 4 months ago

I'm receiving a syntax error when using ejson-rails and psych together. Seems that any special character at the beginning of the string is causing rails credentials to fail when being loaded.

example below

secrets.json

"development": {
  "user": "jsonman",
  "password": "#@@@@hello"
}

I receive in `parse': (): did not find expected node content while parsing a block node at line 16 column 13 (Psych::SyntaxError) in psych-4.0.0/lib/psyche.rb 454

Is this a known problem with psych or do we have a method for handling this issue?

RailsCod3rFuture commented 4 months ago

Fixed this issue by quoting the erb tag inside of the database.yml file password: "<%= Rails.credentials..... %>"