I'm not sure one could easily parse, or moreover report, this error better.

class Foo
  def bar
    p "missing end at next line"
#  end
end

k = Foo.new()
k.bar()
# causes 'sample.rb:9: parse error' here, how informative, isn't it?