Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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:

  • ruby 2.0.0p0 [x86_64-darwin12.2.0] Rails 3.2.13 mysql Ver 14.14 Distrib 5.6.10, for osx10.8 (x86_64)

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
like image 601
BluePython Avatar asked Apr 13 '13 04:04

BluePython


2 Answers

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

like image 139
Jamesking56 Avatar answered Sep 24 '22 19:09

Jamesking56


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

like image 37
richp10 Avatar answered Sep 22 '22 19:09

richp10