I am a newbie to RoR and got the same error while going through RoR "Getting started guide".
This may sound silly, but others might make the same mistake as I am, so posting what I noticed in RoR from newbie's eyes,
validates :name, : presence => true
Note ": presence", it should be ":presence". Now the Rail throws a Syntax error
C:/blog/app/models/post.rb:4: syntax error, unexpected ':', expecting keyword_end
validates :name, : presence => true
But if you "Refresh" Your browser, it hides the syntax error, instead gives
undefined method `key?' for nil:NilClass
It seems Rails caching is the culprit. :)
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…