BluePython
BluePython

Reputation: 1597

rubies/ruby-2.0.0-p0/lib/ruby/2.0.0/psych.rb:205:in `parse': (<unknown>): could not find expected ':' while scanning a simple key at line 18 column 3

This is the full error I am getting when doing a simple:

$ rails generate

Users/localuser/.rvm/rubies/ruby-2.0.0-p0/lib/ruby/2.0.0/psych.rb:205:in `parse': (): could not find expected ':' while scanning a simple key at line 18 column 3(Psych::SyntaxError)

Any ideas whats going on?

My system:

This an extract of the psych.rb file mentioned in the error

#See Psych::Nodes for more information about YAML AST.
def self.parse_stream yaml, filename = nil, &block
  if block_given?
    parser = Psych::Parser.new(Handlers::DocumentStream.new(&block))
    parser.parse yaml, filename
  else
    parser = self.parser
    parser.parse yaml, filename
    parser.handler.root
  end
end

Upvotes: 8

Views: 8188

Answers (3)

richp10
richp10

Reputation: 860

I had this error when I had a tab instead of whitespace in the yaml file.

Upvotes: 2

emrainey
emrainey

Reputation: 51

I had this error when the YAML ended in a NULL '\0' character instead of empty whitespace.

Upvotes: 0

Jamesking56
Jamesking56

Reputation: 3901

This error usually appears if you have a syntax error in your YAML file(s).

Upvotes: 3

Related Questions