unexpected keyword_end, expecting $end (SyntaxError)

只愿长相守 提交于 2019-12-01 03:20:42

This means there is a syntax error and translates to "the end keyword was found when nothing more was expected to complete the program". This is usually due to an unbalanced number of "openers". For instance,

foo.rb: (demonstration)

if true
  puts "hello world"
  end   # the indent
end     # is a lie

Line 4: syntax error, unexpected kEND [keyword_end], expecting $end

Happy coding.

While this is typically a syntax error, I've encountered the exact same error message due to an unknown issue with a gem in my RVM gemset. If you see no syntax errors, try deleting and recreating your gemset.

I've also gotten this without having an extra end by omitting a comma from routes.rb

I got similar error. Found out, it was due to my editor changing the quotes " 'smartly' in the mac editor.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!