unexpected keyword_end, expecting $end (SyntaxError)

后端 未结 4 755
执念已碎
执念已碎 2021-01-11 16:57

hey I am newbie to ruby on rails and I am trying run a simple program from this blog and facing lot of problems error. http://goodbadtech.com/2009/05/13/ruby-on-rails-impor

相关标签:
4条回答
  • 2021-01-11 17:24

    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.

    0 讨论(0)
  • 2021-01-11 17:35

    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.

    0 讨论(0)
  • 2021-01-11 17:39

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

    0 讨论(0)
  • 2021-01-11 17:39

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

    0 讨论(0)
提交回复
热议问题